Configure Inspector with a proper configuration

This commit is contained in:
Bo Maryniuk 2016-07-05 10:03:36 +02:00
parent aed8410398
commit 82ed36ef00

View File

@ -237,7 +237,8 @@ def snapshots():
salt myminion inspector.snapshots
'''
try:
return _("collector").Inspector().db.list()
return _("collector").Inspector(cachedir=__opts__['cachedir'],
piddir=os.path.dirname(__opts__['pidfile'])).db.list()
except InspectorSnapshotException as err:
raise CommandExecutionError(err)
except Exception as err:
@ -261,9 +262,10 @@ def delete(*databases):
try:
ret = dict()
inspector = _("collector").Inspector()
inspector = _("collector").Inspector(cachedir=__opts__['cachedir'],
piddir=os.path.dirname(__opts__['pidfile']))
for dbid in databases:
ret[dbid] = inspector.db.purge(dbid)
ret[dbid] = inspector.db._db.purge(str(dbid))
return ret
except InspectorSnapshotException as err:
raise CommandExecutionError(err)