HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/sdb/__pycache__/etcd_db.cpython-310.pyc
o

�N�ge	�@s�dZddlZzddlZejjjsejjjrdZndZWne	y&dZYnwe�
e�ZddiZ
dZdd	�Zdd
d�Zddd�Zdd
d�Zdd�ZdS)aM
etcd Database Module

:maintainer:    SaltStack
:maturity:      New
:depends:       python-etcd or etcd3-py
:platform:      all

.. versionadded:: 2015.5.0

This module allows access to the etcd database using an ``sdb://`` URI. This
package is located at ``https://pypi.python.org/pypi/python-etcd``.

Like all sdb modules, the etcd module requires a configuration profile to
be configured in either the minion or master configuration file. This profile
requires very little. In the example:

.. code-block:: yaml

    myetcd:
      driver: etcd
      etcd.host: 127.0.0.1
      etcd.port: 2379

The ``driver`` refers to the etcd module, ``etcd.host`` refers to the host that
is hosting the etcd database and ``etcd.port`` refers to the port on that host.

In order to choose whether to use etcd API v2 or v3, you can put the following
configuration option in the same place as your etcd configuration.  This option
defaults to true, meaning you will use v2 unless you specify otherwise.

.. code-block:: yaml

    etcd.require_v2: True

.. code-block:: yaml

    password: sdb://myetcd/mypassword

�NTF�set_�setZetcdcCstrtSdS)z6
    Only load the module if keyring is installed
    F)�HAS_LIBS�__virtualname__�rr�D/opt/saltstack/salt/lib/python3.10/site-packages/salt/sdb/etcd_db.py�__virtual__=srcCs t|�}|�||�t|||�S)z2
    Set a key/value pair in the etcd service
    )�	_get_connr�get)�key�value�service�profile�clientrrrrFscCst|�}|�|�S)�+
    Get a value from the etcd service
    )r	r
�rr
rrrrrr
Os
r
cCs.t|�}z|�|�WdStyYdSw)rTF)r	�delete�	ExceptionrrrrrWs
�rcCstjj�|�S)z
    Get a connection
    )�salt�utils�	etcd_utilZget_conn)rrrrr	csr	)NN)�__doc__�loggingZsalt.utils.etcd_utilrrrZHAS_ETCD_V2ZHAS_ETCD_V3r�ImportError�	getLogger�__name__�logZ__func_alias__rrrr
rr	rrrr�<module>s&)��