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__/consul.cpython-310.pyc
o

�N�g��@s`dZddlmZzddlZdZWneydZYnwddiZd
dd�Zd
d	d
�Zdd�Z	dS)a�
Consul sdb Module

:maintainer:    SaltStack
:maturity:      New
:platform:      all

This module allows access to Consul using an ``sdb://`` URI

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

.. code-block:: yaml

    myconsul:
      driver: consul
      host: 127.0.0.1
      port: 8500
      token: b6376760-a8bb-edd5-fcda-33bc13bfc556
      scheme: http
      consistency: default
      dc: dev
      verify: True

The ``driver`` refers to the Consul module, all other options are optional.
For option details see: https://python-consul.readthedocs.io/en/latest/#consul
�)�CommandExecutionErrorNTF�set_�setcCs|sdSt|�}|j�||�S)NF)�get_conn�kv�put)�key�value�profile�conn�r�C/opt/saltstack/salt/lib/python3.10/site-packages/salt/sdb/consul.pyr+scCs0|sdSt|�}|j�|�\}}|r|dSdS)NFZValue)rr�get)rr
r�_�resultrrr
r4s
rcCs>i}dD]}||vr||||<qtrtjdi|��Std��)z5
    Return a client object for accessing consul
    )�host�port�token�schemeZconsistencyZdcZverifyzY(unable to import consul, module most likely not installed. PLease install python-consul)Nr)�
HAS_CONSUL�consulZConsulr)r
�paramsrrrr
r?s��r)N)
�__doc__Zsalt.exceptionsrrr�ImportErrorZ__func_alias__rrrrrrr
�<module>s�