File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/consul.cpython-310.pyc
o
�N�g� � @ s6 d Z ddlZddlZddlZddlZddlZddlZddl m
Z
e�e�Z
ddiZdZdd� Zd d
� Z dgd
d�Zdhdd�Zdidd�Zdjdd�Zdhdd�Zdkdd�Zdkdd�Zdkdd�Zdkdd�Zdkdd �Zdhd!d"�Zdhd#d$�Zdkd%d&�Zdhd'd(�Zdhd)d*�Z dhd+d,�Z!dhd-d.�Z"dkd/d0�Z#dhd1d2�Z$dhd3d4�Z%dkd5d6�Z&dld7d8�Z'dhd9d:�Z(dhd;d<�Z)dkd=d>�Z*dkd?d@�Z+dkdAdB�Z,dkdCdD�Z-dkdEdF�Z.dhdGdH�Z/dhdIdJ�Z0dhdKdL�Z1dhdMdN�Z2dhdOdP�Z3dhdQdR�Z4dkdSdT�Z5dmdUdV�Z6dkdWdX�Z7dkdYdZ�Z8dkd[d\�Z9dmd]d^�Z:dkd_d`�Z;dkdadb�Z<dhdcdd�Z=dkdedf�Z>dS )nz.
Interact with Consul
https://www.consul.io
� N)�SaltInvocationError�list_�listZconsulc C � t d d�pt d d�S )�'
Retrieve Consul configuration
�
config.getz
consul.urlz
consul:url�Z__salt__� r r �G/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/consul.py�_get_config s r c C r )r r zconsul.tokenzconsul:tokenr r r r r
�
_get_token! s �r �GET�v1c
C sv |si }ddd�}|st � }|dd�}tj�||� d��} tj�| | d�}
|dkr,d }n|d ur=t|t�s<tjj� |�}ntjj� i �}tjj
j|
|||dd|td
�}|�
dd �t
jjkrk|�
d|�|d
<