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/wheel/__pycache__/__init__.cpython-310.pyc
o

�N�g��@sfdZddlmZddlZddlZddlZddlZddlZddl	ZGdd�dej
jjej
jj
�ZeZdS)z+
Modules used to control the master itself
�)�MappingNcsdeZdZdZdZdZd�fdd�	Zdd�Zdd	�Zddd�Z	d
d�Z
					
d�fdd�	Z�ZS)�WheelClienta�
    An interface to Salt's wheel modules

    :ref:`Wheel modules <all-salt.wheel>` interact with various parts of the
    Salt Master.

    Importing and using ``WheelClient`` must be done on the same machine as the
    Salt Master and it must be done using the same user that the Salt Master is
    running as. Unless :conf_master:`external_auth` is configured and the user
    is authorized to execute wheel functions: (``@wheel``).

    Usage:

    .. code-block:: python

        import salt.config
        import salt.wheel
        opts = salt.config.master_config('/etc/salt/master')
        wheel = salt.wheel.WheelClient(opts)
    �wheelNcs(t�j||d�tjj||jd�|_dS)N)�context)�super�__init__�salt�loaderZwheelsrZ	functions)�self�optsr��	__class__��G/opt/saltstack/salt/lib/python3.10/site-packages/salt/wheel/__init__.pyr*szWheelClient.__init__cKs"|j|||�dd�|�dd�d�S)z)
        Backwards compatibility
        �print_eventT�full_returnF)rr)�low�get)r
�fun�kwargsrrr�	call_func/s

�zWheelClient.call_funccKs�|}d|d<|jd}|dkrd}|dkrd}d�tjj�|�t|jd	��}tjjj	j
|jd
|dd��
}|�|�}Wd
�n1sDwYt|t
�r^d|vr^tjjjdi|d��|S)zX
        Execute a wheel function through the master network interface (eauth).
        r�cmd�	interfacez0.0.0.0z	127.0.0.1z::z::1ztcp://{}:{}Zret_port�clear�master_call)Zcrypt�
master_uri�usageN�errorr)r�formatr�utils�networkZ
ip_bracket�str�channel�clientZ
ReqChannel�factory�send�
isinstancerrZraise_error)r
r�loadrrr"�retrrrr<s*
�

��
zWheelClient.master_callFcCs|jdi|��S)a3
        Execute a wheel function synchronously; eauth is respected

        This function requires that :conf_master:`external_auth` is configured
        and the user is authorized to execute runner functions: (``@wheel``).

        .. code-block:: python

            >>> wheel.cmd_sync({
            'fun': 'key.finger',
            'match': 'jerry',
            'eauth': 'auto',
            'username': 'saltdev',
            'password': 'saltdev',
            })
            {'minions': {'jerry': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4:6e:ca'}}
        Nr)r)r
r�timeoutrrrr�cmd_syncVszWheelClient.cmd_synccCs|�d�}|j||dd�S)a
        Execute a function asynchronously; eauth is respected

        This function requires that :conf_master:`external_auth` is configured
        and the user is authorized

        .. code-block:: python

            >>> wheel.cmd_async({
                'fun': 'key.finger',
                'match': 'jerry',
                'eauth': 'auto',
                'username': 'saltdev',
                'password': 'saltdev',
            })
            {'jid': '20131219224744416681', 'tag': 'salt/wheel/20131219224744416681'}
        rF)�local)rZasynchronous)r
rrrrr�	cmd_asyncls
zWheelClient.cmd_asyncTcst��||||||�S)z�
        Execute a function

        .. code-block:: python

            >>> wheel.cmd('key.finger', ['jerry'])
            {'minions': {'jerry': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4:6e:ca'}}
        )rr)r
r�argZpub_data�kwargrrrrrr�szWheelClient.cmd)N)NF)NNNTF)
�__name__�
__module__�__qualname__�__doc__r#Z
tag_prefixrrrr*r,r�
__classcell__rrrrrs
�r)r2�collections.abcrZsalt.channel.clientrZsalt.client.mixinsZsalt.configZsalt.loaderZsalt.utils.errorZsalt.utils.networkr#ZmixinsZSyncClientMixinZAsyncClientMixinrZWheelrrrr�<module>s
�