Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python3.6 /
site-packages /
salt /
sdb /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-10-11 05:09
__init__.py
29
B
-rw-r--r--
2022-05-16 09:16
cache.py
2.71
KB
-rw-r--r--
2022-05-16 09:16
confidant.py
3.69
KB
-rw-r--r--
2022-05-16 09:16
consul.py
1.68
KB
-rw-r--r--
2022-05-16 09:16
couchdb.py
2.34
KB
-rw-r--r--
2022-05-16 09:16
env.py
1.65
KB
-rw-r--r--
2022-05-16 09:16
etcd_db.py
1.95
KB
-rw-r--r--
2022-05-16 09:16
keyring_db.py
2.48
KB
-rw-r--r--
2022-05-16 09:16
memcached.py
1.61
KB
-rw-r--r--
2022-05-16 09:16
redis_sdb.py
1.72
KB
-rw-r--r--
2022-05-16 09:16
rest.py
3.25
KB
-rw-r--r--
2022-05-16 09:16
sqlite3.py
3.57
KB
-rw-r--r--
2022-05-16 09:16
tism.py
2.16
KB
-rw-r--r--
2022-05-16 09:16
vault.py
2.89
KB
-rw-r--r--
2022-05-16 09:16
yaml.py
2.53
KB
-rw-r--r--
2022-05-16 09:16
Save
Rename
""" CouchDB sdb Module :maintainer: SaltStack :maturity: New :depends: python2-couchdb :platform: all This allow interaction between Salt and a CouchDB [couchdb.apache.org] database. It uses salt's `sdb` system to allow for inserts and retrevals using the `sdb://` prefix in salt configuration files. To use the couchbase sdb module, it must first be configured in the salt master or minion config. The following arguments are required: .. code-block:: yaml couchdb_sdb: driver: couchdb host: localhost port: 5984 database: salt_sdb One could then query the CouchDB instance via an `sdb://` URI such as the following: .. code-block:: yaml password: sdb://couchdb_sdb/mykey To use this interface, you must track IDs on your own or have another source to do the map-reduce logic necessary to calculate the ID you wish to fetch. Additional contributions to build true map-reduce functionality into this module would be welcome. """ # Import Python libraries import logging from uuid import uuid4 # Import Salt libraries from salt.utils.decorators import memoize try: import couchdb HAS_COUCH = True except ImportError: HAS_COUCH = False log = logging.getLogger(__name__) # 'set' is a reserved word __func_alias__ = {"set_": "set"} def __virtual__(): """ Require the python2-couchdb libraries """ return HAS_COUCH @memoize def _construct_uri(profile): """ Examine configuration and return a uri for the couchdb server in the following format: .. code-block:: bash http://localhost:5984/ """ return "http://{host}:{port}".format(**profile) def _get_conn(profile): """ Get a connection to CouchDB """ DEFAULT_BASE_URL = _construct_uri(profile) or "http://localhost:5984" server = couchdb.Server() if profile["database"] not in server: server.create(profile["database"]) return server def set_(key, value, profile=None): """ Set a key/value pair in couchdb """ db = _get_db(profile) return db.save({"_id": uuid4().hex, key: value}) def get(key, profile=None): """ Get a value from couchdb by id """ db = _get_db(profile) return db.get(key) def _get_db(profile): """ Wraps _get_conn() to return a db """ server = _get_conn(profile) db = _get_db(profile) return db