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/states/__pycache__/cisconso.cpython-310.pyc
o

�N�g��@s.dZddlZdd�Zdd�ZGdd�d�ZdS)	z�
State module for Cisco NSO Proxy minions

.. versionadded:: 2016.11.0

For documentation on setting up the cisconso proxy minion look in the documentation
for :mod:`salt.proxy.cisconso <salt.proxy.cisconso>`.
�NcCsdtvrdSdS)N�cisconso.set_data_valueT)Fz#cisconso module could not be loaded)�__salt__�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/cisconso.py�__virtual__
srcCs�|didd�}td||�}tjj�||�r d|d<d|d<|Std	durMd
|d<d|d<t||�}|��|dd
<|��|dd<|�	�|dd<|Std|||�d|d<d|d<t||�}|��|dd
<|��|dd<|�	�|dd<|S)a�
    Ensure a specific value exists at a given path

    :param name: The name for this rule
    :type  name: ``str``

    :param datastore: The datastore, e.g. running, operational.
        One of the NETCONF store IETF types
    :type  datastore: :class:`DatastoreType` (``str`` enum).

    :param path: The device path to set the value at,
        a list of element names in order, / separated
    :type  path: ``list``, ``str`` OR ``tuple``

    :param config: The new value at the given path
    :type  config: ``dict``

    Examples:

    .. code-block:: yaml

        enable pap auth:
          cisconso.config_present:
            - name: enable_pap_auth
            - datastore: running
            - path: devices/device/ex0/config/sys/interfaces/serial/ppp0/authentication
            - config:
                authentication:
                    method: pap
                    "list-name": foobar

    F�)�name�result�changes�commentzcisconso.get_dataTr	zConfig is already setr�testNzConfig will be addedr
�new�removed�changedrzSuccessfully added config)
r�salt�utils�compat�cmpZ__opts__�_DictDiffer�addedrr)rZ	datastore�pathZconfig�ret�existing�diffrrr�
value_presents,!�
�
rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rz�
    Calculate the difference between two dictionaries as:
    (1) items added
    (2) items removed
    (3) keys same in both but changed values
    (4) keys same in both and unchanged values
    cCs@|||_|_t|���t|���|_|_|j�|j�|_dS�N)�current_dict�	past_dict�set�keys�set_current�set_past�intersection�	intersect)�selfrrrrr�__init__Ys



�z_DictDiffer.__init__cC�|j|jSr)r r#�r$rrrra�z_DictDiffer.addedcCr&r)r!r#r'rrrrdr(z_DictDiffer.removedc��fdd��jD�S)Ncs$h|]}�j|�j|kr|�qSr�rr��.0�or'rr�	<setcomp>h�$z&_DictDiffer.changed.<locals>.<setcomp>�r#r'rr'rrg�z_DictDiffer.changedcr))Ncs$h|]}�j|�j|kr|�qSrr*r+r'rrr.kr/z(_DictDiffer.unchanged.<locals>.<setcomp>r0r'rr'r�	unchangedjr1z_DictDiffer.unchangedN)	�__name__�
__module__�__qualname__�__doc__r%rrrr2rrrrrPsr)r6Zsalt.utils.compatrrrrrrrr�<module>s
	=