003 File Manager
Current Path:
/usr/local/lib/python3.8/site-packages/salt/modules/inspectlib
usr
/
local
/
lib
/
python3.8
/
site-packages
/
salt
/
modules
/
inspectlib
/
📁
..
📄
__init__.py
(1.59 KB)
📁
__pycache__
📄
collector.py
(18.28 KB)
📄
dbhandle.py
(2.58 KB)
📄
entities.py
(1.63 KB)
📄
exceptions.py
(956 B)
📄
fsdb.py
(9.56 KB)
📄
kiwiproc.py
(8.1 KB)
📄
query.py
(16.95 KB)
Editing: __init__.py
# # Copyright 2015 SUSE LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os from salt.modules.inspectlib.dbhandle import DBHandle from salt.modules.inspectlib.exceptions import InspectorSnapshotException class EnvLoader: """ Load environment. """ PID_FILE = "_minion_collector.pid" DB_FILE = "_minion_collector.db" DEFAULT_PID_PATH = "/var/run" DEFAULT_CACHE_PATH = "/var/cache/salt" 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 )
Upload File
Create Folder