def __init__(self, scope): ''' Constructor. :param scope: :return: ''' if scope not in self.SCOPES: raise InspectorQueryException( "Unknown scope: {0}. Must be one of: {1}".format( repr(scope), ", ".join(self.SCOPES))) self.scope = '_' + scope self.db = DBHandle(globals()['__salt__']['config.get']('inspector.db', '')) self.local_identity = dict()
def __init__(self, db_path=None, pid_file=None): # Configured path if not db_path and '__salt__' in globals(): db_path = globals().get('__salt__')['config.get']('inspector.db', '') if not db_path: raise InspectorSnapshotException("Inspector database location is not configured yet in minion.") self.dbfile = db_path self.db = DBHandle(self.dbfile) self.db.open() if not pid_file and '__salt__' in globals(): pid_file = globals().get('__salt__')['config.get']('inspector.pid', '') if not pid_file: raise InspectorSnapshotException("Inspector PID file location is not configured yet in minion.") self.pidfile = pid_file
def __init__(self, cachedir=None, piddir=None, pidfilename=None): """ Constructor. :param options: :param db_path: :param pid_file: """ if not cachedir and "__salt__" in globals(): cachedir = globals().get("__salt__")["config.get"]("inspector.db", "") self.dbfile = os.path.join(cachedir or self.DEFAULT_CACHE_PATH, self.DB_FILE) self.db = DBHandle(self.dbfile) if not piddir and "__salt__" in globals(): piddir = globals().get("__salt__")["config.get"]("inspector.pid", "") self.pidfile = os.path.join( piddir or self.DEFAULT_PID_PATH, pidfilename or self.PID_FILE )
def __init__(self, cachedir=None, piddir=None, pidfilename=None): ''' Constructor. :param options: :param db_path: :param pid_file: ''' if not cachedir and '__salt__' in globals(): cachedir = globals().get('__salt__')['config.get']('inspector.db', '') self.dbfile = os.path.join(cachedir or self.DEFAULT_CACHE_PATH, self.DB_FILE) self.db = DBHandle(self.dbfile) if not piddir and '__salt__' in globals(): piddir = globals().get('__salt__')['config.get']('inspector.pid', '') self.pidfile = os.path.join(piddir or self.DEFAULT_PID_PATH, pidfilename or self.PID_FILE)