HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/executors/__pycache__/sudo.cpython-310.pyc
o

;jg�@s<dZddlZddlZddlZddlZdZdd�Zdd�ZdS)z
Sudo executor module
�N�sudocCs tjj�d�rt�d�rtSdS)Nr�	sudo_userF)�salt�utils�path�whichZ__opts__�get�__virtualname__�r
r
�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/executors/sudo.py�__virtual__srcCs�dd|�d�dd|�d�dddd	|�d
�d|�d�g
}|dd
vr%d|d<|D]}|�t�t|���q'|D]}|�t�|�d||����q6td|ddd�}|ddkrptjj�	|d�d}	|	d}
|	�dd�t
d<|
S|d}
|dt
d<|
S)a�
    Allow for the calling of execution modules via sudo.

    This module is invoked by the minion if the ``sudo_user`` minion config is
    present.

    Example minion config:

    .. code-block:: yaml

        sudo_user: saltdev

    Once this setting is made, any execution module call done by the minion will be
    run under ``sudo -u <sudo_user> salt-call``.  For example, with the above
    minion config,

    .. code-block:: bash

        salt sudo_minion cmd.run 'cat /etc/sudoers'

    is equivalent to

    .. code-block:: bash

        sudo -u saltdev salt-call cmd.run 'cat /etc/sudoers'

    being run on ``sudo_minion``.
    rz-urz	salt-callz--privz--out�jsonz
--metadataz-cZ
config_dirz--Zfun)z	state.slszstate.highstatezstate.applyTZ
concurrent�=zcmd.run_allF)Zuse_vtZpython_shell�retcoder�stdout�local�return�stderr)r�append�shlex�quote�strZ__salt__rrr
�loads�__context__)�opts�data�func�args�kwargs�cmd�arg�keyZcmd_retZcmd_meta�retr
r
r�executes:� �r#)	�__doc__rZ
salt.syspathsrZsalt.utils.jsonZsalt.utils.pathr	rr#r
r
r
r�<module>s