%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/cmdmod.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl!Zddl"Zddl#m$Z$ddl%m&Z&m'Z'm(Z(ddl)m*Z*ddl+m,Z,m-Z-m.Z.yddl/Z/ddl0Z0Wne1k
rnXej2j3j4�rAddl5m6Z7dd	l8m9Z:e;Z<ndd
l+m=Z:e>Z<dgZ?dZ@ejAeB�ZCejDjEjF�d
ZGd�ZHd�ZId�ZJd�ZKdeLeLd�ZMdd�ZNd�ZOd�ZPd�ZQeLeLe
jRe
jReLdeLeLeLeGe>eLe>eLe;eLeLeLe;e;e>deLeLe>eLe>e>eLd�ZSeLeLeLeLeGe>eLeLeLeLe;deLeLeLd�ZTeLeLeLeGe>eLeLeLeLe;deLeLeLeLd�ZUeLeLeLeLeGeLeLe>eLe;eLeLdeLe>eLe;e>de>e>eLe>e>eLeLd�ZVeLeLeLeLeGeLe>eLe;eLeLdeLe>eLe;e>de>e>eLeLeLd�ZFeLeLeLeLeGeLeLe>eLe;eLeLdeLe>eLe;e>de>eLeLeLd�ZWeLeLeLeLeGeLeLe>eLe;eLeLdeLe>eLe;e>de>eLeLeLd �ZXeLeLeLeLeGeLeLe>eLe;eLeLdeLe>eLe;e>de>e>eLe>eLeLd!�ZYeLeLeLeLeGeLeLe>eLeLeLdeLeLe;e>de>eLeLd"�ZZeLeLeLeLeGe>eLe>eLeLeLeLeLe;e>de>eLeLd#�Z[eLeLeLeLeLeGeLeLeLeLeLdeLe>eLe;de>e>eLeLd$�Z\eLeLeLeLeLeGeLeLd%eLeLe;deLdeLe>eLeLd&�Z]d'�Z^d(�Z_d)�Z`eLeLd*�ZaeLeLd+�Zbd,d-�ZceLeLeLeLeGe;eLe>eLe;eLeLd.eLe>eLe;e>de>e>eLd/�Zdd0�Zed1�Zfe>d2�ZgeLeLeLeGeLe>eLe;eLeLde>eLe;e>de>eLeLe>eLd3�ZheLeLeLeGeLe>eLe;eLeLde>eLe;e>de>eLeLe>e>eLd4�ZieLeLeLeGeLeLe>eLeLeLeLdeLe;e>deLeLeLd5�ZjdS(6u�
A module for shelling out.

Keep in mind that this module is insecure, in that it can give whomever has
access to the master root execution access to all salt minions.
i(tabsolute_importtprint_functiontunicode_literalsN(tsix(tCommandExecutionErrortTimedProcTimeoutErrortSaltInvocationError(t
LOG_LEVELS(trangetziptmap(trunas(tescape_argument(tshlex_quoteu*ucmdushellcC@stS(N(t__virtualname__(((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt__virtual__KscC@s6|dk	r/t|d�r|Stjd�nd�S(uh
    If the callback is None or is not callable, return a lambda that returns
    the value passed.
    u__call__u&log_callback is not callable, ignoringcS@s|S(N((tx((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt<lambda>YsN(tNonethasattrtlogterror(tcb_((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt	_check_cbOs
cC@sZyB|r|dkrtStjdt�tkrA|dkrAtSWntk
rUnX|S(uU
    Set python_shell default based on remote execution and __opts__['cmd_safe']
    ucmd_safeN(RtTruet__opts__tgettFalset	NameError(tpython_shellt	__pub_jid((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_python_shell_default\s$
cC@s�g}x~tjd�D]m}yStjj|�}|j|�rn|jttjjtjj|����nWqt	k
r�qXqW|S(Nu/proc/[0-9]*/root(
tglobtostpathtrealpatht
startswithtappendtinttbasenametdirnametOSError(tchroottpidstroottlink((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_chroot_pidsms 
ubasec@s��s||fS�tjjjkr=tdj����ni�t�d<|d	k	se|d	k	r�|prtd}t	||��d<n
t
�d<t�d<t�d<|�d<��fd�}||�}||�}||fS(
ub
    If template is a valid template engine, process the cmd and cwd through
    that engine.
    u:Attempted to render file paths with unavailable engine {0}usaltu	pillarenvupillarugrainsuoptsusaltenvc@s�tjjj�}tjjj|d��#}|jtjjj|��WdQXtjjj	�|dt
��}tjjj|�|ds�tdj
|d���n|dSdS(Nuw+tto_struresultu%Failed to execute cmd with error: {0}udata(tsalttutilstfilestmkstemptfopentwritetstringutilsR/t	templatestTEMPLATE_REGISTRYRtsafe_rmRtformat(tcontentsttmp_path_fntfp_tdata(tkwargsttemplate(s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_render�s"	
N(R0R1R7R8RR:t__salt__RRt_gather_pillart
__pillar__t
__grains__(tcmdtcwdR@tsaltenvt	pillarenvtpillar_overrideRA((R?R@s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_render_cmd{s&





uinfocC@ssy(|j�}|dkrdSt|SWnDttfk
rntjd|djttdt	���tdSXdS(uB
    Retrieve the level code for use in logging.Logger.log().
    uquietuKInvalid output_loglevel '%s'. Valid levels are: %s. Falling back to 'info'.u, treverseuinfoN(
tlowerRRtAttributeErrortKeyErrorRRtjointsortedR(tlevel((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_check_loglevel�scC@sR|si}nt|t�r6tjjj|�}nt|t�sNi}n|S(N(t
isinstancetlistR0R1R>trepack_dictlisttdict(tenv((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt
_parse_env�s		c	C@sdtjjtttdtdd|d|�}|j�}|r`t|t�r`|j|�n|S(uC
    Whenever a state run starts, gather the pillar data fresh
    uidusaltenvRJRI(	R0tpillart
get_pillarRREtcompile_pillarRTRWtupdate(RIRJRZtret((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyRC�s	
	cC@st|t�rUdjg|D]-}t|tj�sCtj|�n|^q�}nt}t}tdd�r�tddg�}x,|D]!}t	j	||�r�t}q�q�Wntddg�r	tddg�}x3|D]"}t	j	||�r�t}Pq�q�Wnt}|o|S(u6
    Check to see if the given command can be run
    u u
config.getucmd_blacklist_globucmd_whitelist_glob(
RTRURPRtstring_typest	text_typeRRRBtfnmatch(RFRtbrettwrettblisttcomp((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_check_avail�s$	=

udebugc>&K@s�d|kr |r |d}n|dkrQt|
�tkrQtjd|
�nt|�}t|�}t}|d-kr�dt�kr�tj	d�}n|d-kr�dt�kr�tj	d�}n|sAt
jjdj
|s�dn|��}t
j|t
j�sPd	}tjjj�r>t
jjt
j�}q>qPntj|�}|ret}t}ntjjj�s�t
jj|
�s�t
j|
t
j�r�d
j
|
�} t| ��q�ntjjj�r�|r�td��n|
j�j�dkr�t|tj�r!|j�}nt j!d
d�}!|!dddkrTd|}q�|rldj
|�}q�dj
|j"dd��}nt#||||||�\}}i}"d|kr�t$|�s�tdj
|���q�nt%|�}x;d�tj&|�D�D] }#tj'd|#�d||#<q
Wd�}$|d-k	r�dj
t|t(�s^dnd|$|�|rdj
|�nd|	r�dj
|	�nd||r�dnd�} tj)|| ��n|r5tjjj�r5t*s�d } t| ��nt|t(t+f�r"d!j,|�}nt-||||�S|r�tjjj.�r�t|t(t+f�r}d!j,t/t0|��}nd"j
d#t0|�d$|�}d%j
d$t0|��}d&j
t0|�t0|��}d-}n|ryt1j2|�Wqt3k
rtd'j
|���qXn|	r�tjjj�rJd(} t4| ��nt5d)g�snd*} t| ��nyt6j7|	�Wn&t3k
r�td+j
|���q�Xt}n|s�|	r�	y�d,d-l8}%d.t9|%j:��d/}&|&j;t<�}'d0|&d1|&d2}(|r�d)g})|r6|)j=d3|g�n|	rR|)j=d4|	g�n|
t>krz|)j=d5d6|
d7g�n|)j=d8d6g�|)j=t?j@g�n�tAd9d�kr�d;d<|d7d=j
|
t?j@�f})nttAd>d�krd;d<|d7t?j@f})nItAd>d�kr0d;d<|d7t?j@f})nd;d5|
d<|d7t?j@f})dAj
|)�} tjB|| ��tCjD|)dBtCjEdCtCjEdDtCjE�jFtjjGjH|(��\}*}+|*jI|'�},|,d,kr�tj'dE||+|*�dF}*nN|,dkr-tdGdHitJ|+�dI6tJ|*�dJ6��n|*jK|'�dK}*tjLr�d,d-lM}-tN|-jOtP|*jKdL��gd��}.n:tjQr�tNt(tRtP|*jKdL��gd���}.ntNdM�tj&|.�D��}.|.jS|�|.j	dN�|kr	||.dN<nt
jjdj
|��}/|.j	dO�|/krH	|/|.dO<n|.}Wq�	tTk
r�	}0tjUdP|�tdQj
||0���q�	Xn|tkr�
tjjj�s�
|jVdRdS�|jVdTdS�|jVdUdS�|jVdVdS�|jVdWdS�|jVdXdS�|jVdYdS�|jVdZdS�|jVd[dS�|jVd\dS�|jVd]dS�|jVd^dS�|jVd_dS�q�
|r�
d`|}q�
n|
r�
|}1nLtjjj�r�
d,d-lW}2|2jXjY�}1nt
jXjY�}1|1jS|�|rdaj,||1dbf�|1db<n|d-kr-t}ni	|dc6|dd6tjQrM|1ntjjZj;|1�de6|d-k	r~tj|�n|df6|dJ6|dI6|dg6|dh6|di6}3dj|kr�|dj|3dj<n|d-k	rLtj|�j[dk�}4|4dkr
dl} t| ��nyt\|4dm�}4WqRtTk
rHtdnj
|���qRXnd-}4|sd|	sd|r�t]j^tjj_j`||4|	�|3do<ntjjj�s�|3ddtkr�|
|3dp<nt|3dq<nt
jja|�s�t
jjb|�r
tdrj
|���n|tk	rM
tjjj�rM
t|t(�rM
tjjcjd|�}n|d-kre
d,g}nRy2gtjjcje|�D]}5t\|5�^q~
}WntTk
r�
t4ds��nX|s�ytjjfjg||3�}6Wn�thtifk
r{}0dtj
|d-k	r	|ndu|3�} y9|0jjd-kr4| dv7} n| dwj
|0|0jj�7} Wntkk
rk| dx7} nXt| ��nXy|6jl�WnUtmk
r�}0tj|0�|"dJ<d|"dI<d-|"dy<|6jnjo|"dz<dK|"dy<|"SX|dkr|d-k	rtjBd{||�ny"tjjGjp|6jqd||�}7Wnjtrk
rKd}7nTtsk
r�tjjGjp|6jqd||d}d~�}7|dkr�tj'd|�q�nXy"tjjGjp|6jtd||�}8Wnjtrk
r�d}8nTtsk
r-tjjGjp|6jtd||d}d~�}8|dkr.tj'd�|�q.nX|rm|7d-k	rO|7ju�}7n|8d-k	rm|8ju�}8qmn|6jnjo|"dz<|6jnjv|"dy<|"dy|kr�d,|"dy<n|7|"dJ<|8|"dI<n�d}9|r�d�j
|�}9n|d-k	rd�j
||9�} tjB|| ��nd�\}}twjw�}:|r>|:|};nd�};ztjjxjy|d�td�td�td�|d�|3j	dod-�d�|1d�|d�|d�|d�td�t�}6|6jo|"dz<x�|6jzrXy�y�twj{d��y|6j|�\}<}=Wntik
rd�\}<}=nX|<r||<7}nd}<|=r8||=7}nd}=|rztwjw�|;krzd�j
||�|"dI<d-|"dy<PnWn/t}k
r�d�j
|�|"dI<dK|"dy<PnXWnJtjjxj~k
r�}0tj'd�|0d�tj��idKdy6d�dz6}"PnX||"dJ<|6j��sH||"dI<|6j�|"dy<|"dy|krHd,|"dy<qHn|6jo|"dz<q�WWd-|6j�d�td�t�Xy%|r�d,tdy<n|"dytdy<Wnt�k
r�nX|d-k	r�|r|"dyd,kr|t�d�kr�t�d�}nd�j
||"dy�} tj'|| ��n|"dJrItj|d�j
||"dJ���n|"dIrytj|d�j
||"dI���n|"dyr�tj|d�j
|"dy��q�n|"S(�u@
    Do the DRY thing and only call subprocess.Popen() once
    upillaruquietu}Attempt to run a shell command with what may be an invalid shell! Check to ensure that the shell <%s> is valid for this user.u__context__urunasurunas_passwordu~{0}uu/uThe shell {0} is not availableuVT not available on windowsu
powershelltlimitii����uscriptuDPowershell -NonInteractive -NoProfile -ExecutionPolicy Bypass -File u.Powershell -NonInteractive -EncodedCommand {0}u+Powershell -NonInteractive -NoProfile "{0}"u"u\"u	__pub_jidu(The shell command "{0}" is not permittedcs@s'|]\}}|dkr|VqdS(N(R(t.0Rty((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pys	<genexpr>psuREnvironment variable '%s' passed without a value. Setting value to an empty stringcS@sht|t�rDg|D]*}t|tj�r:|j�n|^qSt|tj�r`|j�S|SdS(N(RTRURR_tstrip(RFR((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt
_get_strippedus
5
u7Executing command {0}{1}{0} {2}{3}in directory '{4}'{5}u'uas user '{0}' uin group '{0}' u@. Executing command in the background, no output will be logged.umissing salt/utils/win_runas.pyu ucd -- {dir} && {{ {cmd}
 }}tdirRFu/bin/bash -l -c {cmd}usu -l {0} -c {1}uUser '{0}' is not availableu+group is not currently available on Windowsusudou*group argument requires sudo but not founduGroup '{0}' is not availableiNu<<<u>>>u-import sys, os, itertools; sys.stdout.write("uY"); sys.stdout.write("\0".join(itertools.chain(*os.environ.items()))); sys.stdout.write("u");u-uu-gu-su--u-cu-iuosuFreeBSDusuu-u
{0} -c {1}u	os_familyuSolarisuAIXuenv command: {0}tstderrtstdouttstdinuEEnvironment could not be retrieved for user '%s': stderr=%r stdout=%rtu1Environment could not be retrieved for user '{0}'tinfoustderrustdoutitcs@s?|]5\}}tjjj|�tjjj|�fVqdS(N(R0R1R6R/(Rhtktv((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pys	<genexpr>suUSERuHOMEu/Error raised retrieving environment for user %su6Environment could not be retrieved for user '{0}': {1}uLC_CTYPEuCu
LC_NUMERICuLC_TIMEu
LC_COLLATEuLC_MONETARYuLC_MESSAGESuLC_PAPERuLC_NAMEu
LC_ADDRESSuLC_TELEPHONEuLC_MEASUREMENTuLC_IDENTIFICATIONuLANGUAGEuchcp 437 > nul & u:uPATHucwdushelluenvustdinuwith_communicateutimeoutubgustdin_raw_newlinesu0uZero umask is not allowed.iuInvalid umask: '{0}'u
preexec_fnu
executableu	close_fdsu9Specified cwd '{0}' either not absolute or does not existu+success_retcodes must be a list of integersu<Unable to run command '{0}' with the context '{1}', reason: uREDACTEDucommand not foundu{0}: {1}uunknownuretcodeupidu1Decoding output from command %s using %s encodingtencodingterrorsureplaceuTFailed to decode stdout from command %s, non-decodable characters have been replaceduTFailed to decode stderr from command %s, non-decodable characters have been replacedu (timeout: {0}s)uRunning {0} in VT{1}i����tshellt
log_stdoutt
log_stderrRGt
preexec_fnRXtlog_stdin_leveltlog_stdout_leveltlog_stderr_levelt
stream_stdoutt
stream_stderrg�?uSALT: Timeout after {0}s
{1}uSALT: User break
{0}uVT: %stexc_info_on_loglevelu2t	terminatetkilluerroru*Command '{0}' failed with return code: {1}ustdout: {0}ustderr: {0}uretcode: {0}(uFreeBSD(uSolaris(uAIX(uu(uu(�t_is_valid_shellRRtwarningRSRRtglobalst__context__RR!R"t
expanduserR:taccesstR_OKR0R1tplatformt
is_windowstabspathtsepRR`RtisfiletX_OKRRMRjRTR_t	tracebackt
extract_stacktreplaceRKRfRYt	iteritemsRRURqt
HAS_WIN_RUNASttupleRPt	win_runast	is_darwinR
t
_cmd_quotetpwdtgetpwnamRORt	which_bintgrptgetgrnamtuuidtstrtuuid4tencodet__salt_system_encoding__textendt
DEFAULT_SHELLtsyst
executableREtdebugt
subprocesstPopentPIPEtcommunicateR6tto_bytestcounttreprtsplittPY2t	itertoolsRWtiziptitertPY3R	R]t
ValueErrort	exceptiont
setdefaulttnttenvirontcopyR>tlstripR&t	functoolstpartialtusertchugid_and_umasktisabstisdirtargstshlex_splittsplit_inputttimed_subprocesst	TimedProcR)tIOErrortfilenameRNtrunRtprocesstpidt
to_unicodeRnt	TypeErrortUnicodeDecodeErrorRmtrstript
returncodettimetvttTerminalthas_unread_datatsleeptrecvtKeyboardInterrupttTerminalExceptiontloggingtDEBUGtisalivet
exitstatustcloseRR(>RFRGRoRnRmtoutput_encodingtoutput_logleveltlog_callbackRtgroupRwRRXt	clean_envtprepend_pathR�R@tumaskttimeouttwith_communicatetreset_system_localetignore_retcodeRHRIRJtuse_vttpasswordtbgtencoded_cmdtsuccess_retcodesR?tuse_sudotmsgtstackR^tbad_env_keyRkR�tmarkertmarker_btpy_codetenv_cmdt	env_bytestenv_encoded_errtmarker_countR�t	env_runast
runas_hometexctrun_envR�t
new_kwargst_umasktitproctoutterrtformatted_timeouttnowtwill_timeouttcstdouttcstderr((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_run�s�"

'	)
! 					

				
		.	1



	
 	
%"



&#

	




	
	

	
			

	
		



	







	








&
&
#c&C@s}t|d|d|d|dtjd|ddddd	|d
|d|d|d
|	d|
d|d|d|
d|d|�dS(u@
    Helper for running commands quietly for minion startup
    RRGRoRmR�R�uquietR�RwRRXR@R�R�R�RHRIRJR�ustdoutN(RR�tSTDOUTR(RFRGRoR�RRwRRXR@R�R�R�RHRIRJR�((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt
_run_quietTs&		c$C@spt|d|d|d|d|d|d|d|dd	d
dd|d|d
|	d|
d|d|d|
d|�S(uj
    Helper for running commands quietly for minion startup.
    Returns a dict of return data.

    output_loglevel argument is ignored. This is here for when we alias
    cmd.run_all directly to _run_all_quiet in certain chicken-and-egg
    situations where modules need to work both before and after
    the __salt__ dictionary is populated (cf dracr.py)
    RRGRoRwRRXR�R�uquietR�R@R�R�R�RHRIRJR�N(RR(RFRGRoRRwRRXR@R�R�R�RHRIRJR�R�((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_run_all_quiet|s$	c5K@s�t||jdd��}t|d|d|d|d|d|d|d	tjd
|d|d|d
|	d|
d|d|d|
d|d|d|d|d|d|d|d|d|d||�}t|�}t|
�}|d"k	r�|rr|ddkrr|tdkrtd}ndj	||d�}t
j||��|rrt||s`|d nd���qrnt
j
|d!||d ��n|s�|d SdS(#u�
    Execute the passed command and return the output as a string

    :param str cmd: The command to run. ex: ``ls -lart /home``

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running.

        .. warning::

            For versions 2018.3.3 and above on macosx while using runas,
            to pass special characters to the command you need to escape
            the characters on the shell.

            Example:

            .. code-block:: bash

                cmd.run 'echo '\''h=\"baz\"'\''' runas=macuser

    :param str group: Group to run command as. Not currently supported
        on Windows.

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

        .. versionadded:: 2016.3.0

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If ``False``, let python handle the positional
        arguments. Set to ``True`` to use shell features, such as pipes or
        redirection.

    :param bool bg: If ``True``, run command in background and do not await or
        deliver it's results

        .. versionadded:: 2016.3.0

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.run 'some command' env='{"FOO": "bar"}'

    :param bool clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str prepend_path: $PATH segment to prepend (trailing ':' not
        necessary) to $PATH

        .. versionadded:: 2018.3.0

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param bool rstrip: Strip all whitespace off the end of output before it is
        returned.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param bool hide_output: If ``True``, suppress stdout and stderr in the
        return data.

        .. note::
            This is separate from ``output_loglevel``, which only handles how
            Salt logs to the minion log.

        .. versionadded:: 2018.3.0

    :param int timeout: A timeout in seconds for the executed process to return.

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
        more interactively to the console and the logs. This is experimental.

    :param bool encoded_cmd: Specify if the supplied command is encoded.
        Only applies to shell 'powershell'.

    :param bool raise_err: If ``True`` and the command has a nonzero exit code,
        a CommandExecutionError exception will be raised.

    .. warning::
        This function does not process commands through a shell
        unless the python_shell flag is set to True. This means that any
        shell-specific functionality such as 'echo' or the use of pipes,
        redirection or &&, should either be migrated to cmd.shell or
        have the python_shell=True flag set here.

        The use of python_shell=True means that the shell will accept _any_ input
        including potentially malicious commands such as 'good_command;rm -rf /'.
        Be absolutely certain that you have sanitized your input prior to using
        python_shell=True

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.run "ls -l | awk '/foo/{print \\$2}'"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

    .. code-block:: bash

        salt '*' cmd.run template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \\$2}'"

    Specify an alternate shell with the shell parameter:

    .. code-block:: bash

        salt '*' cmd.run "Get-ChildItem C:\\ " shell='powershell'

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.

    .. code-block:: bash

        salt '*' cmd.run "grep f" stdin='one\\ntwo\\nthree\\nfour\\nfive\\n'

    If an equal sign (``=``) appears in an argument to a Salt command it is
    interpreted as a keyword argument in the format ``key=val``. That
    processing can be bypassed in order to pass an equal sign through to the
    remote shell command by manually specifying the kwarg:

    .. code-block:: bash

        salt '*' cmd.run cmd='sed -e s/=/:/g'
    u	__pub_jiduRR�RwRRGRoRmRXR�R�R@R�R�R�R�R�R�R�R�RHR�R�R�R�R�uretcodeiuerroru*Command '{0}' failed with return code: {1}ustdoutu
output: %sN(
RRRR�R	RRSRRR:RRR(RFRGRoRR�RwRRXR�R@R�R�R�R�R�thide_outputR�R�R�RHR�R�R�R�t	raise_errR�R�R?R^tlvlR�((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyR��sX�			

% c3K@s�d|kr|jd�}nt}t|d|d|d|d|d|d|d|d	|d
|d|	d|
d
|d|d|
d|d|d|d|d|d|d|d|d|d||�S(u0
    Execute the passed command and return the output as a string.

    .. versionadded:: 2015.5.0

    :param str cmd: The command to run. ex: ``ls -lart /home``

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

        .. warning::

            For versions 2018.3.3 and above on macosx while using runas,
            to pass special characters to the command you need to escape
            the characters on the shell.

            Example:

            .. code-block:: bash

                cmd.shell 'echo '\''h=\"baz\"'\''' runas=macuser

    :param str group: Group to run command as. Not currently supported
      on Windows.

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

        .. versionadded:: 2016.3.0

    :param int shell: Shell to execute under. Defaults to the system default
        shell.

    :param bool bg: If True, run command in background and do not await or
        deliver its results

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.shell 'some command' env='{"FOO": "bar"}'

    :param bool clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str prepend_path: $PATH segment to prepend (trailing ':' not necessary)
        to $PATH

        .. versionadded:: 2018.3.0

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param bool rstrip: Strip all whitespace off the end of output before it is
        returned.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param bool hide_output: If ``True``, suppress stdout and stderr in the
        return data.

        .. note::
            This is separate from ``output_loglevel``, which only handles how
            Salt logs to the minion log.

        .. versionadded:: 2018.3.0

    :param int timeout: A timeout in seconds for the executed process to
        return.

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
        more interactively to the console and the logs. This is experimental.

    .. warning::

        This passes the cmd argument directly to the shell without any further
        processing! Be absolutely sure that you have properly sanitized the
        command passed to this function and do not use untrusted inputs.

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.shell "ls -l | awk '/foo/{print \$2}'"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

    .. code-block:: bash

        salt '*' cmd.shell template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \$2}'"

    Specify an alternate shell with the shell parameter:

    .. code-block:: bash

        salt '*' cmd.shell "Get-ChildItem C:\ " shell='powershell'

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.

    .. code-block:: bash

        salt '*' cmd.shell "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'

    If an equal sign (``=``) appears in an argument to a Salt command it is
    interpreted as a keyword argument in the format ``key=val``. That
    processing can be bypassed in order to pass an equal sign through to the
    remote shell command by manually specifying the kwarg:

    .. code-block:: bash

        salt '*' cmd.shell cmd='sed -e s/=/:/g'
    upython_shellRGRoRR�RwRXR�R�R@R�R�R�R�R�RR�R�R�RHR�RR�R�R�(tpopRR�(RFRGRoRR�RwRXR�R@R�R�R�R�R�RR�R�R�RHR�R�R�R�R�R?R((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyRw�s:�	c/K@s�t||jdd��}t|d|d|d|d|d|d|d	|d
|d|d|	d
|
d|d|d|
d|d|d|d|d|d|d|d||�}|s�|dSdS(un
    Execute a command, and only return the standard out

    :param str cmd: The command to run. ex: ``ls -lart /home``

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

        .. warning::

            For versions 2018.3.3 and above on macosx while using runas,
            to pass special characters to the command you need to escape
            the characters on the shell.

            Example:

            .. code-block:: bash

                cmd.run_stdout 'echo '\''h=\"baz\"'\''' runas=macuser

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

        .. versionadded:: 2016.3.0

    :param str group: Group to run command as. Not currently supported
      on Windows.

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
        arguments. Set to True to use shell features, such as pipes or
        redirection.

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.run_stdout 'some command' env='{"FOO": "bar"}'

    :param bool clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str prepend_path: $PATH segment to prepend (trailing ':' not necessary)
        to $PATH

        .. versionadded:: 2018.3.0

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param bool rstrip: Strip all whitespace off the end of output before it is
        returned.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param bool hide_output: If ``True``, suppress stdout and stderr in the
        return data.

        .. note::
            This is separate from ``output_loglevel``, which only handles how
            Salt logs to the minion log.

        .. versionadded:: 2018.3.0

    :param int timeout: A timeout in seconds for the executed process to
        return.

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
        more interactively to the console and the logs. This is experimental.

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.run_stdout "ls -l | awk '/foo/{print \$2}'"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

    .. code-block:: bash

        salt '*' cmd.run_stdout template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \$2}'"

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.

    .. code-block:: bash

        salt '*' cmd.run_stdout "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'
    u	__pub_jiduRR�RGRoRwRRXR�R�R@R�R�R�R�R�R�R�R�RHR�R�R�ustdout(RRR(RFRGRoRR�RwRRXR�R@R�R�R�R�R�RR�R�R�RHR�R�R�R�R?R^((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt
run_stdout�s6�		c/K@s�t||jdd��}t|d|d|d|d|d|d|d	|d
|d|d|	d
|
d|d|d|
d|d|d|d|d|d|d|d||�}|s�|dSdS(uo
    Execute a command and only return the standard error

    :param str cmd: The command to run. ex: ``ls -lart /home``

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

        .. warning::

            For versions 2018.3.3 and above on macosx while using runas,
            to pass special characters to the command you need to escape
            the characters on the shell.

            Example:

            .. code-block:: bash

                cmd.run_stderr 'echo '\''h=\"baz\"'\''' runas=macuser

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

        .. versionadded:: 2016.3.0

    :param str group: Group to run command as. Not currently supported
      on Windows.

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
        arguments. Set to True to use shell features, such as pipes or
        redirection.

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.run_stderr 'some command' env='{"FOO": "bar"}'

    :param bool clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str prepend_path: $PATH segment to prepend (trailing ':' not
        necessary) to $PATH

        .. versionadded:: 2018.3.0

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param bool rstrip: Strip all whitespace off the end of output before it is
        returned.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param bool hide_output: If ``True``, suppress stdout and stderr in the
        return data.

        .. note::
            This is separate from ``output_loglevel``, which only handles how
            Salt logs to the minion log.

        .. versionadded:: 2018.3.0

    :param int timeout: A timeout in seconds for the executed process to
        return.

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
        more interactively to the console and the logs. This is experimental.

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.run_stderr "ls -l | awk '/foo/{print \$2}'"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

    .. code-block:: bash

        salt '*' cmd.run_stderr template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \$2}'"

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.

    .. code-block:: bash

        salt '*' cmd.run_stderr "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'
    u	__pub_jiduRR�RGRoRwRRXR�R�R@R�R�R�R�R�R�R�R�R�RHR�R�ustderr(RRR(RFRGRoRR�RwRRXR�R@R�R�R�R�R�RR�R�R�RHR�R�R�R�R?R^((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt
run_stderrns6�		c3K@s�t||jdd��}|r*tjntj}t|d|d|d|d|d|d|d	|d
|d|d|d
|	d|
d|d|d|
d|d|d|d|d|d|d|d|d||�}|r�d|d<|d<n|S(u�
    Execute the passed command and return a dict of return data

    :param str cmd: The command to run. ex: ``ls -lart /home``

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

        .. warning::

            For versions 2018.3.3 and above on macosx while using runas,
            to pass special characters to the command you need to escape
            the characters on the shell.

            Example:

            .. code-block:: bash

                cmd.run_all 'echo '\''h=\"baz\"'\''' runas=macuser

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

        .. versionadded:: 2016.3.0

    :param str group: Group to run command as. Not currently supported
      on Windows.

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
        arguments. Set to True to use shell features, such as pipes or
        redirection.

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.run_all 'some command' env='{"FOO": "bar"}'

    :param bool clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str prepend_path: $PATH segment to prepend (trailing ':' not
        necessary) to $PATH

        .. versionadded:: 2018.3.0

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param bool rstrip: Strip all whitespace off the end of output before it is
        returned.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param bool hide_output: If ``True``, suppress stdout and stderr in the
        return data.

        .. note::
            This is separate from ``output_loglevel``, which only handles how
            Salt logs to the minion log.

        .. versionadded:: 2018.3.0

    :param int timeout: A timeout in seconds for the executed process to
        return.

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
        more interactively to the console and the logs. This is experimental.

    :param bool encoded_cmd: Specify if the supplied command is encoded.
       Only applies to shell 'powershell'.

       .. versionadded:: 2018.3.0

    :param bool redirect_stderr: If set to ``True``, then stderr will be
        redirected to stdout. This is helpful for cases where obtaining both
        the retcode and output is desired, but it is not desired to have the
        output separated into both stdout and stderr.

        .. versionadded:: 2015.8.2

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

          .. versionadded:: 2016.3.0

    :param bool bg: If ``True``, run command in background and do not await or
        deliver its results

        .. versionadded:: 2016.3.6

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.run_all "ls -l | awk '/foo/{print \$2}'"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

    .. code-block:: bash

        salt '*' cmd.run_all template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \$2}'"

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.

    .. code-block:: bash

        salt '*' cmd.run_all "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'
    u	__pub_jiduRR�RGRoRmRwRRXR�R�R@R�R�R�R�R�R�R�R�RHR�R�R�R�ustdoutustderr(RRR�R	R�R(RFRGRoRR�RwRRXR�R@R�R�R�R�R�RR�R�R�RHR�tredirect_stderrR�R�R�R�R?RmR^((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pytrun_all>s@�		c-K@s�t||jdd��}t|d|d|d|d|dtjd|d	|d
|d|d|	d
|
d|d|d|
d|d|d|d|d|d|d||�}|dS(u
    Execute a shell command and return the command's return code.

    :param str cmd: The command to run. ex: ``ls -lart /home``

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

        .. warning::

            For versions 2018.3.3 and above on macosx while using runas,
            to pass special characters to the command you need to escape
            the characters on the shell.

            Example:

            .. code-block:: bash

                cmd.retcode 'echo '\''h=\"baz\"'\''' runas=macuser

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

        .. versionadded:: 2016.3.0

    :param str group: Group to run command as. Not currently supported
      on Windows.

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
        arguments. Set to True to use shell features, such as pipes or
        redirection.

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.retcode 'some command' env='{"FOO": "bar"}'

    :param bool clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param bool rstrip: Strip all whitespace off the end of output before it is
        returned.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param int timeout: A timeout in seconds for the executed process to return.

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
      more interactively to the console and the logs. This is experimental.

    :rtype: int
    :rtype: None
    :returns: Return Code as an int or None if there was an exception.

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.retcode "file /bin/bash"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

    .. code-block:: bash

        salt '*' cmd.retcode template=jinja "file {{grains.pythonpath[0]}}/python"

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.

    .. code-block:: bash

        salt '*' cmd.retcode "grep f" stdin='one\ntwo\nthree\nfour\nfive\n'
    u	__pub_jiduRR�RGRoRmRwRRXR�R@R�R�R�R�R�R�R�RHR�R�R�uretcode(RRRR�R	(RFRGRoRR�RwRRXR�R@R�R�R�R�R�R�R�RHR�R�R�R?R^((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pytretcode+s4�			c+K@s�t|d|d|d|d|d|d|d|d|d	|	d
|
d|dd
d|d|
d|d|d|d|d|d||�S(um
    Helper for running commands quietly for minion startup. Returns same as
    the retcode() function.
    RGRoRR�RwRRXR�R@R�R�R�uquietR�R�R�R�RHR�R�R�(R(RFRGRoRR�RwRRXR�R@R�R�R�R�R�R�RHR�R�R�R?((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_retcode_quiet�s,	c+K@sbt||jdd��}d�}d|kr@|jd�nt}tjjj�r�|r�|d/kr�t	j
dtd�}t}tjj
jd|d|d	d
�ntjjjd|dtjj|�d�}|	r�d
|ks�d|kr1|jd
tjd
��}t||jd��|d<ntd|||	||�}|s||�|rp||�nidd6dd6dd6dd6td6Snmtd||�}|s�||�|r�||�nidd6dd6dd6dd6td6Stj||�tjjj�sItj|d�tj|td|�d�ntjjj�r�|j�dkr�t|dt�}nt|�}t|r�|dtj|�n|d|d|d|d |d!|
d"|d#|d$|d%|d&|d'|
d(|d)|d*|d+|d,|d-|d.||�}||�|rC||�n|r^d|d<|d<n|S(0u�
    Download a script from a remote location and execute the script locally.
    The script can be located on the salt master file server or on an HTTP/FTP
    server.

    The script will be executed directly, so it can be written in any available
    programming language.

    :param str source: The location of the script to download. If the file is
        located on the master in the directory named spam, and is called eggs,
        the source string is salt://spam/eggs

    :param str args: String of command line args to pass to the script. Only
        used if no args are specified as part of the `name` argument. To pass a
        string containing spaces in YAML, you will need to doubly-quote it:

        .. code-block:: bash

            salt myminion cmd.script salt://foo.sh "arg1 'arg two' arg3"

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

        .. versionadded:: 2016.3.0

    :param str group: Group to run script as. Not currently supported
      on Windows.

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
        arguments. Set to True to use shell features, such as pipes or
        redirection.

    :param bool bg: If True, run script in background and do not await or
        deliver it's results

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.script 'some command' env='{"FOO": "bar"}'

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param bool hide_output: If ``True``, suppress stdout and stderr in the
        return data.

        .. note::
            This is separate from ``output_loglevel``, which only handles how
            Salt logs to the minion log.

        .. versionadded:: 2018.3.0

    :param int timeout: If the command has not terminated after timeout
        seconds, send the subprocess sigterm, and if sigterm is ignored, follow
        up with sigkill

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
        more interactively to the console and the logs. This is experimental.

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.script salt://scripts/runme.sh
        salt '*' cmd.script salt://scripts/runme.sh 'arg1 arg2 "arg 3"'
        salt '*' cmd.script salt://scripts/windows_task.ps1 args=' -Input c:\tmp\infile.txt' shell='powershell'


    .. code-block:: bash

        salt '*' cmd.script salt://scripts/runme.sh stdin='one\ntwo\nthree\nfour\nfive\n'
    u	__pub_jiducS@sNytd|�Wn5ttfk
rI}tjd||dtj�nXdS(Nufile.removeu-cmd.script: Unable to clean tempfile '%s': %sR�(RBRRRRR�R�(R"R�((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt_cleanup_tempfile�	su__env__Rlucachedirtobj_namet	principaltpermissionsufull_controltsuffixiu	pillarenvupillarucp.get_templateiupiduretcodeustdoutustderrucache_erroru
cp.cache_filei@ufile.user_to_uidi����u
powershelltescapeu RGRoR�R�R�RR�RwRRXR�R�R�RHR�R�R�R�N(RRRRR0R1R�R�RttempfiletmkdtempRRtwin_dacltset_permissionsR2R3R!R"tsplitextRCRBtshutiltcopyfiletchmodtchownRMR�RRR`(tsourceR�RGRoRR�RwRRXR@R�R�R�R�RR�R�RHR�R�R�R�R?Rtwin_cwdR"RItfn_tcmd_pathR^((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pytscript	s��		$
.
	





 $&	

ujinjac*K@s�d|kr|jd�ntd|d|d|d|d|d|d|d	|d
|d|	d|
d
|d|d|
d|d|d|d|d|d||�dS(u�
    Download a script from a remote location and execute the script locally.
    The script can be located on the salt master file server or on an HTTP/FTP
    server.

    The script will be executed directly, so it can be written in any available
    programming language.

    The script can also be formatted as a template, the default is jinja.

    Only evaluate the script return code and do not block for terminal output

    :param str source: The location of the script to download. If the file is
        located on the master in the directory named spam, and is called eggs,
        the source string is salt://spam/eggs

    :param str args: String of command line args to pass to the script. Only
        used if no args are specified as part of the `name` argument. To pass a
        string containing spaces in YAML, you will need to doubly-quote it:
        "arg1 'arg two' arg3"

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

        .. versionadded:: 2016.3.0

    :param str group: Group to run script as. Not currently supported
      on Windows.

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
        arguments. Set to True to use shell features, such as pipes or
        redirection.

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.script_retcode 'some command' env='{"FOO": "bar"}'

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param int timeout: If the command has not terminated after timeout
        seconds, send the subprocess sigterm, and if sigterm is ignored, follow
        up with sigkill

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
        more interactively to the console and the logs. This is experimental.

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.script_retcode salt://scripts/runme.sh
        salt '*' cmd.script_retcode salt://scripts/runme.sh 'arg1 arg2 "arg 3"'
        salt '*' cmd.script_retcode salt://scripts/windows_task.ps1 args=' -Input c:\tmp\infile.txt' shell='powershell'

    A string of standard input can be specified for the command to be run using
    the ``stdin`` parameter. This can be useful in cases where sensitive
    information must be read from standard input.

    .. code-block:: bash

        salt '*' cmd.script_retcode salt://scripts/runme.sh stdin='one\ntwo\nthree\nfour\nfive\n'
    u__env__R%R�RGRoRR�RwRRXR@R�R�R�RHR�R�R�R�R�R�uretcode(RR)(R%R�RGRoRR�RwRRXR@R�R�R�RHR�R�R�R�R�R�R?((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pytscript_retcode!
s.�cC@stjjj|�S(u�
    Returns the path of an executable available on the minion, None otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.which cat
    (R0R1R"twhich(RF((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyR+�
s
cC@stjjj|�S(u�
    Returns the first command found in a list of commands

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.which_bin '[pip2, pip, pip-python]'
    (R0R1R"R�(tcmds((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyR��
s
cC@st|�dk	S(u�
    Returns true if the executable is available on the minion, false otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.has_exec cat
    N(R+R(RF((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pythas_exec�
s
cK@st|||||�dS(u
    Pass in two strings, the first naming the executable language, aka -
    python2, python3, ruby, perl, lua, etc. the second string containing
    the code you wish to execute. The stdout will be returned.

    All parameters from :mod:`cmd.run_all <salt.modules.cmdmod.run_all>` except python_shell can be used.

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.exec_code ruby 'puts "cheese"'
        salt '*' cmd.exec_code ruby 'puts "cheese"' args='["arg1", "arg2"]' env='{"FOO": "bar"}'
    ustdout(t
exec_code_all(tlangtcodeRGR�R?((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt	exec_code�
sc
K@s|j�jd�}|r6tjjjdd�}ntjjj�}tjjj|ddt��#}|jtjj	j
|��WdQX|r�|d|g}n||g}t|tj
�r�|j|�nt|t�r�||7}nt|d|d	t|�}	tj|�|	S(
u5
    Pass in two strings, the first naming the executable language, aka -
    python2, python3, ruby, perl, lua, etc. the second string containing
    the code you wish to execute. All cmd artifacts (stdout, stderr, retcode, pid)
    will be returned.

    All parameters from :mod:`cmd.run_all <salt.modules.cmdmod.run_all>` except python_shell can be used.

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.exec_code_all ruby 'puts "cheese"'
        salt '*' cmd.exec_code_all ruby 'puts "cheese"' args='["arg1", "arg2"]' env='{"FOO": "bar"}'
    u
powershellRu.ps1uw+ttbinaryNu-FileRGR(RMR$R0R1R2R3R4RR5R6R/RTRR_R%RURR!tremove(
R/R0RGR�R?t
powershelltcodefileR=RFR^((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyR.
s !"

ucC@s�|jd�r!dj|�}n8|jd�rNdj|jdd��}nidd6SyUtjjj|d��#}|jtjjj	|��WdQXid	j|�d
6SWn"t
k
r�idj|�d6SXdS(u�
    Echo a string to a specific tty

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.tty tty0 'This is a test'
        salt '*' cmd.tty pts3 'This is a test'
    uttyu/dev/{0}uptsupts/u'The specified device is not a valid TTYuErroruwbNu&Message was successfully echoed to {0}uSuccessuEchoing to {0} returned error(R$R:R�R0R1R2R4R5R6R�R�(tdevicetechotteletypet
tty_device((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyttty6s"
uquietc 0K@s�tdtjj|d�ddd�tdtjj|d�ddd�tdtjj|d�ddd�d}tjjtjj|d	��r�d
}nt|ttf�r�djg|D]}tj	|�^q��}ndj
||t|��}tj
d
t�}||d|d|d|d|d|d|d|d|	d|
d|d|d|
d|d|d|d|d|d|d |jd!�d"|jd#�d$|d%|d&|�}xctd'�D]U}t|�}|s�Pnx6|D].}|d(krd)nd*}tj||�q�Wq�Wt|�r<tjd+�ntd,tjj|d��td,tjj|d��td,tjj|d��|r�d-|d.<|d/<n|S(0u�
    .. versionadded:: 2014.7.0

    This function runs :mod:`cmd.run_all <salt.modules.cmdmod.run_all>` wrapped
    within a chroot, with dev and proc mounted in the chroot

    :param str root: Path to the root of the jail to use.

    stdin
        A string of standard input can be specified for the command to be run using
        the ``stdin`` parameter. This can be useful in cases where sensitive
        information must be read from standard input.:

    runas
        User to run script as.

    group
        Group to run script as.

    shell
        Shell to execute under. Defaults to the system default shell.

    :param str cmd: The command to run. ex: ``ls -lart /home``

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :parar str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
        arguments. Set to True to use shell features, such as pipes or
        redirection.

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.run_chroot 'some command' env='{"FOO": "bar"}'

    :param dict clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param bool rstrip:
        Strip all whitespace off the end of output before it is returned.

    :param str umask:
         The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param bool hide_output: If ``True``, suppress stdout and stderr in the
        return data.

        .. note::
            This is separate from ``output_loglevel``, which only handles how
            Salt logs to the minion log.

        .. versionadded:: 2018.3.0

    :param int timeout:
        A timeout in seconds for the executed process to return.

    :param bool use_vt:
        Use VT utils (saltstack) to stream the command output more
        interactively to the console and the logs. This is experimental.

    success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.run_chroot /var/lib/lxc/container_name/rootfs 'sh /tmp/bootstrap.sh'
    umount.mountudevudevtmpfstfstypeuprocusysusysfsu/bin/shubin/bashu	/bin/bashu uchroot {0} {1} -c {2}ucmd.run_chroot.funcRR�RGRoRwRRXR�R@R�R�R�R�R�R�R�R�RHRIu	pillarenvRZupillarR�R�R�iiii	uOProcesses running in chroot could not be killed, filesystem will remain mountedumount.umountuustdoutustderr(RBR!R"RPR�RTRUR�RR`R:R�R�RRRRR.R�RR( R,RFRGRoRR�RwRRXR�R@R�R�R�R�R�RR�R�R�RHR�R�R�R?tsh_R�trun_funcR^R+R�tsig((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt
run_chrootSst�!	.		
cC@s�tjjj�rtSd}g}tjj|�r�y�tjjj	|d��;}g|j
�j�D]}tjjj
|�^qe}WdQXx0|D](}|jd�r�q�q�|j|�q�WWq�tk
r�tSXndS||kr�tStSdS(ue
    Attempts to search for valid shells on a system and
    see if a given shell is in the list
    u/etc/shellsurNu#(R0R1R�R�RR!R"texistsR2R4treadt
splitlinesR6R�R$R%R)RR(Rwtshellstavailable_shellstshell_fpRtlinestline((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyR�2s&7

cC@s�d}g}tjj|�r�y�tjjj|d��;}g|j�j�D]}tjj	j
|�^qO}WdQXxH|D]@}|j�}|jd�r�q}q}|s�q}q}|j
|�q}WWq�tk
r�tjd|�q�Xn|S(u�
    Lists the valid shells on this system via the /etc/shells file

    .. versionadded:: 2015.5.0

    CLI Example::

        salt '*' cmd.shells
    u/etc/shellsurNu#uFile '%s' was not found(R!R"R@R0R1R2R4RARBR6R�RjR$R%R)RR(t	shells_fnR^RERRFRG((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyRCPs"
7

cC@s�idddgd6dddgd6ddddgd	6d
ddgd6dd
dgd
6ddddgd6ddddgd6ddddgd6dddgd6ddd gd6d!d"d gd"6}itd#6}tjjj�r	|dkr	tjjjd$d%d&d'�}|jd&t�t	|�d(kr?id)d*6td#6Sx�|D]�}tjjj
d$d%d&d+j|�d,d-�}|jd.�d/krF|jd0�d1krFtjjj
d$d%d&d2j|��}i}d=|d#<td3�|d4<x|D]
}|d5j�d6krq�q�|d5j�d7krH|d0|d8<|d0|d9<q�|d5j�d:kr�|d0|d;<|d;d(j�d<kr�|d;d1d=d=�|d;<q�q�|d5j�d>kr�|d0jd?d@�jdA�|dB<q�|d0||d5j�<q�WqFqFWn�||kr0idCj|�d*6d=d#6S||}	|	jd(�}
tjjj�rsd(d=l}|j}n	tj}dD|kr�tjjj�r�tjjdE�|dD<tjdF|dD�ny=tjjj|	dGd=dHtjdItjdJdKdL|�}
Wn=t t!fk
rD}idMjd?j"|	�|�d*6td#6SXy|
j#�Wn4t$k
r�}idNjd?j"|	��d*6td#6SXt|	d(�|d4<t%j&|
|
j'dOt%j(�}|r�|j)d1�|d9<nd9|kret%j*dP|d9�}|rot+|d#<|j)d1�jdQ�dR }t	|�d1krH|j,dS�ndQj"|dR �|dT<qon
d=|d#<|dkr�|d#r�|r�tjj-j.�|dU<ndT|kr�dVj|�|d*<|
j'|dW<tj/|d*�n|S(Xu�
    .. versionadded:: 2016.11.0

    Provides information about a shell or script languages which often use
    ``#!``. The values returned are dependent on the shell or scripting
    languages all return the ``installed``, ``path``, ``version``,
    ``version_raw``

    Args:
        shell (str): Name of the shell. Support shells/script languages include
        bash, cmd, perl, php, powershell, python, ruby and zsh

        list_modules (bool): True to list modules available to the shell.
        Currently only lists powershell modules.

    Returns:
        dict: A dictionary of information about the shell

    .. code-block:: python

        {'version': '<2 or 3 numeric components dot-separated>',
         'version_raw': '<full version string>',
         'path': '<full path to binary>',
         'installed': <True, False or None>,
         '<attribute>': '<attribute value>'}

    .. note::
        - ``installed`` is always returned, if ``None`` or ``False`` also
          returns error and may also return ``stdout`` for diagnostics.
        - ``version`` is for use in determine if a shell/script language has a
          particular feature set, not for package management.
        - The shell must be within the executable search path.

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.shell_info bash
        salt '*' cmd.shell_info powershell

    :codeauthor: Damon Atkins <https://github.com/damon-atkins>
    uversion (\d\S*)ubashu	--versionuversioZ ([-\w.]+)ubash-test-erroru	(HOME=.*)u-cudeclareu
bash-test-envu^zsh (\d\S*)uzshu
^tcsh (\d\S*)utcshuVersion ([\d.]+)ucmd.exeu/CuverucmduPSVersion\s+(\d\S*)u
powershellu-NonInteractiveu$PSVersionTableu^(\d\S*)uperlu-euprintf "%vd
", $^V;u^Python (\d\S*)upythonu-Vu
^ruby (\d\S*)urubyu-vu^PHP (\d\S*)uphpu	installedthiveuHKEY_LOCAL_MACHINEtkeyuSoftware\Microsoft\PowerShelliuBUnable to locate 'powershell' Reason: Cannot be found in registry.uerroru!Software\Microsoft\PowerShell\{0}tvnameuInstalluvtypeu	REG_DWORDuvdataiu2Software\Microsoft\PowerShell\{0}\PowerShellEngineupowershell.exeupathuvnameu	(default)upowershellversionu	psversionuversion_rawuruntimeversionu
crlversionuvNupscompatibleversionu uu,upscompatibleversionsu8Salt does not know how to get the version number for {0}uHOMEu~uHOME environment set to %sRoRnRmR�i
RXu'Unable to run command '{0}' Reason: {1}u.Unable to run command '{0}' Reason: Timed out.tflagsu
(\d[\d.]*)u.iu0uversionumodulesuJThe version regex pattern for shell {0}, could not find the version stringustdout(0RR0R1R�R�twin_regt	list_keystsortR&tlent
read_valueR:Rtlist_valuesRR+RMR�R�RR�R�R!R"R�RR�R�R�R�R�R	R)R�RPR�RtretsearchRnt
IGNORECASER�tmatchRR%R4tget_modulesR(Rwtlist_modulestregex_shellsR^tpw_keystreg_vertinstall_datatdetailst	attributet
shell_datatpatternR�tnewenvRR�tpattern_resulttversion_resultstver_list((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt
shell_infons�+
	
	

!&&

			
		



c-K@s�d|kr|jd�}nt}td�d}tjjj|d�dkr�|d7}|d$k	r�|dj|�7}q�n|r�t	j
d|�|jd	�jd
�}t
j|�}t}nt}d|d}t|d
|d|d|ddd|d|d|d|d|	d|
d|d|d|
d|d|d|d|d|d|d |d!||�}ytjjj|�SWn%tk
r�t	jd"d#t�iSXd$S(%u�
    Execute the passed PowerShell command and return the output as a dictionary.

    Other ``cmd.*`` functions (besides ``cmd.powershell_all``)
    return the raw text output of the command. This
    function appends ``| ConvertTo-JSON`` to the command and then parses the
    JSON into a Python dictionary. If you want the raw textual result of your
    PowerShell command you should use ``cmd.run`` with the ``shell=powershell``
    option.

    For example:

    .. code-block:: bash

        salt '*' cmd.run '$PSVersionTable.CLRVersion' shell=powershell
        salt '*' cmd.run 'Get-NetTCPConnection' shell=powershell

    .. versionadded:: 2016.3.0

    .. warning::

        This passes the cmd argument directly to PowerShell
        without any further processing! Be absolutely sure that you
        have properly sanitized the command passed to this function
        and do not use untrusted inputs.

    In addition to the normal ``cmd.run`` parameters, this command offers the
    ``depth`` parameter to change the Windows default depth for the
    ``ConvertTo-JSON`` powershell command. The Windows default is 2. If you need
    more depth, set that here.

    .. note::
        For some commands, setting the depth to a value greater than 4 greatly
        increases the time it takes for the command to return and in many cases
        returns useless data.

    :param str cmd: The powershell command to run.

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
      command to be run using the ``stdin`` parameter. This can be useful in cases
      where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

    :param str password: Windows only. Required when specifying ``runas``. This
      parameter will be ignored on non-Windows platforms.

      .. versionadded:: 2016.3.0

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
      arguments. Set to True to use shell features, such as pipes or
      redirection.

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.powershell 'some command' env='{"FOO": "bar"}'

    :param bool clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param bool rstrip: Strip all whitespace off the end of output before it is
        returned.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param bool hide_output: If ``True``, suppress stdout and stderr in the
        return data.

        .. note::
            This is separate from ``output_loglevel``, which only handles how
            Salt logs to the minion log.

        .. versionadded:: 2018.3.0

    :param int timeout: A timeout in seconds for the executed process to return.

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
        more interactively to the console and the logs. This is experimental.

    :param bool reset_system_locale: Resets the system locale

    :param str saltenv: The salt environment to use. Default is 'base'

    :param int depth: The number of levels of contained objects to be included.
        Default is 2. Values greater than 4 seem to greatly increase the time
        it takes for the command to complete for some commands. eg: ``dir``

        .. versionadded:: 2016.3.4

    :param bool encode_cmd: Encode the command before executing. Use in cases
        where characters may be dropped or incorrectly converted when executed.
        Default is False.

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    :returns:
        :dict: A dictionary of data returned by the powershell command.

    CLI Example:

    .. code-block:: powershell

        salt '*' cmd.powershell "$PSVersionTable.CLRVersion"
    upython_shellu
powershellu	psversionu2.0iu | ConvertTo-JSONu -Depth {0}u Encoding PowerShell command '%s'uutf-8uutf-16leutry {u} catch { "{}" }RGRoRRwRXR�R@R�R�R�R�RR�R�R�RHR�RR�R�R�u'Error converting PowerShell JSON returntexc_infoN(RRReR0R1tversionstversion_cmpRR:RR�tdecodeR�tbase64tstandard_b64encodeRR�tjsontloadst	ExceptionR(RFRGRoRRwRXR�R@R�R�R�R�RR�R�R�RHR�R�tdeptht
encode_cmdR�R?Rt	psversiont	cmd_utf16R�tresponse((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyR4$
sV�
			
c-K@sd|kr|jd�}nt}|d7}|tk	rP|dj|�7}n|r�tjd|�|jd�jd�}tj	|�}t}nt
}t|d|d|d	|d
dd|d
|d|d|d|	d|
d|d|d|
d|d|d|d|d|d|d|d||�}|d}|ra|jd�|rZg|d<n|Snytj
jj|�}Wn:tk
r�dd }||d!<td"|d#|��nX|jd�t|�tk	r�|r�|g|d<n
||d<n
||d<|S($u�)
    Execute the passed PowerShell command and return a dictionary with a result
    field representing the output of the command, as well as other fields
    showing us what the PowerShell invocation wrote to ``stderr``, the process
    id, and the exit code of the invocation.

    This function appends ``| ConvertTo-JSON`` to the command before actually
    invoking powershell.

    An unquoted empty string is not valid JSON, but it's very normal for the
    Powershell output to be exactly that. Therefore, we do not attempt to parse
    empty Powershell output (which would result in an exception). Instead we
    treat this as a special case and one of two things will happen:

    - If the value of the ``force_list`` parameter is ``True``, then the
      ``result`` field of the return dictionary will be an empty list.

    - If the value of the ``force_list`` parameter is ``False``, then the
      return dictionary **will not have a result key added to it**. We aren't
      setting ``result`` to ``None`` in this case, because ``None`` is the
      Python representation of "null" in JSON. (We likewise can't use ``False``
      for the equivalent reason.)

    If Powershell's output is not an empty string and Python cannot parse its
    content, then a ``CommandExecutionError`` exception will be raised.

    If Powershell's output is not an empty string, Python is able to parse its
    content, and the type of the resulting Python object is other than ``list``
    then one of two things will happen:

    - If the value of the ``force_list`` parameter is ``True``, then the
      ``result`` field will be a singleton list with the Python object as its
      sole member.

    - If the value of the ``force_list`` parameter is ``False``, then the value
      of ``result`` will be the unmodified Python object.

    If Powershell's output is not an empty string, Python is able to parse its
    content, and the type of the resulting Python object is ``list``, then the
    value of ``result`` will be the unmodified Python object. The
    ``force_list`` parameter has no effect in this case.

    .. note::
         An example of why the ``force_list`` parameter is useful is as
         follows: The Powershell command ``dir x | Convert-ToJson`` results in

         - no output when x is an empty directory.
         - a dictionary object when x contains just one item.
         - a list of dictionary objects when x contains multiple items.

         By setting ``force_list`` to ``True`` we will always end up with a
         list of dictionary items, representing files, no matter how many files
         x contains.  Conversely, if ``force_list`` is ``False``, we will end
         up with no ``result`` key in our return dictionary when x is an empty
         directory, and a dictionary object when x contains just one file.

    If you want a similar function but with a raw textual result instead of a
    Python dictionary, you should use ``cmd.run_all`` in combination with
    ``shell=powershell``.

    The remaining fields in the return dictionary are described in more detail
    in the ``Returns`` section.

    Example:

    .. code-block:: bash

        salt '*' cmd.run_all '$PSVersionTable.CLRVersion' shell=powershell
        salt '*' cmd.run_all 'Get-NetTCPConnection' shell=powershell

    .. versionadded:: 2018.3.0

    .. warning::

        This passes the cmd argument directly to PowerShell without any further
        processing! Be absolutely sure that you have properly sanitized the
        command passed to this function and do not use untrusted inputs.

    In addition to the normal ``cmd.run`` parameters, this command offers the
    ``depth`` parameter to change the Windows default depth for the
    ``ConvertTo-JSON`` powershell command. The Windows default is 2. If you need
    more depth, set that here.

    .. note::
        For some commands, setting the depth to a value greater than 4 greatly
        increases the time it takes for the command to return and in many cases
        returns useless data.

    :param str cmd: The powershell command to run.

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str stdin: A string of standard input can be specified for the
        command to be run using the ``stdin`` parameter. This can be useful in
        cases where sensitive information must be read from standard input.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
        arguments. Set to True to use shell features, such as pipes or
        redirection.

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.powershell_all 'some command' env='{"FOO": "bar"}'

    :param bool clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param bool rstrip: Strip all whitespace off the end of output before it is
        returned.

    :param str umask: The umask (in octal) to use when running the command.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param int timeout: A timeout in seconds for the executed process to
        return.

    :param bool use_vt: Use VT utils (saltstack) to stream the command output
        more interactively to the console and the logs. This is experimental.

    :param bool reset_system_locale: Resets the system locale

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param str saltenv: The salt environment to use. Default is 'base'

    :param int depth: The number of levels of contained objects to be included.
        Default is 2. Values greater than 4 seem to greatly increase the time
        it takes for the command to complete for some commands. eg: ``dir``

    :param bool encode_cmd: Encode the command before executing. Use in cases
        where characters may be dropped or incorrectly converted when executed.
        Default is False.

    :param bool force_list: The purpose of this parameter is described in the
        preamble of this function's documentation. Default value is False.

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    :return: A dictionary with the following entries:

        result
            For a complete description of this field, please refer to this
            function's preamble. **This key will not be added to the dictionary
            when force_list is False and Powershell's output is the empty
            string.**
        stderr
            What the PowerShell invocation wrote to ``stderr``.
        pid
            The process id of the PowerShell invocation
        retcode
            This is the exit code of the invocation of PowerShell.
            If the final execution status (in PowerShell) of our command
            (with ``| ConvertTo-JSON`` appended) is ``False`` this should be non-0.
            Likewise if PowerShell exited with ``$LASTEXITCODE`` set to some
            non-0 value, then ``retcode`` will end up with this value.

    :rtype: dict

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.powershell_all "$PSVersionTable.CLRVersion"

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.powershell_all "dir mydirectory" force_list=True
    upython_shellu | ConvertTo-JSONu -Depth {0}u Encoding PowerShell command '%s'uutf-8uutf-16leRGRoRRwu
powershellRXR�R@R�R�R�R�tquietR�R�R�RHR�RR�R�R�ustdouturesultucmd.powershell_all u#cannot parse the Powershell output.ucmdtmessageRq(RRRR:RR�RiR�RjRkRRR0R1RlRmRnRttypeRU(RFRGRoRRwRXR�R@R�R�R�R�RtR�R�R�RHR�R�RoRpt
force_listR�R?RRrR�Rst	stdoutputtresultterr_msg((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pytpowershell_allst�
			








c5K@s�t||jdd��}t|ddddddd|d|ddd	td
tdtd|d
|d|d|d|d|d|d|d|d|	d|
d|
d|d|d|d||�}i|dd6S(u�
    .. versionadded: 2016.3.0

    Execute the passed command in the background and return it's PID

    .. note::

        If the init system is systemd and the backgrounded task should run even
        if the salt-minion process is restarted, prepend ``systemd-run
        --scope`` to the command. This will reparent the process in its own
        scope separate from salt-minion, and will not be affected by restarting
        the minion service.

    :param str cmd: The command to run. ex: ``ls -lart /home``

    :param str cwd: The directory from which to execute the command. Defaults
        to the home directory of the user specified by ``runas`` (or the user
        under which Salt is running if ``runas`` is not specified).

    :param str group: Group to run command as. Not currently supported
      on Windows.

    :param str shell: Shell to execute under. Defaults to the system default
      shell.

    :param str output_encoding: Control the encoding used to decode the
        command's output.

        .. note::
            This should not need to be used in most cases. By default, Salt
            will try to use the encoding detected from the system locale, and
            will fall back to UTF-8 if this fails. This should only need to be
            used in cases where the output of the command is encoded in
            something other than the system locale or UTF-8.

            To see the encoding Salt has detected from the system locale, check
            the `locale` line in the output of :py:func:`test.versions_report
            <salt.modules.test.versions_report>`.

        .. versionadded:: 2018.3.0

    :param str output_loglevel: Control the loglevel at which the output from
        the command is logged to the minion log.

        .. note::
            The command being run will still be logged at the ``debug``
            loglevel regardless, unless ``quiet`` is used for this value.

    :param bool ignore_retcode: If the exit code of the command is nonzero,
        this is treated as an error condition, and the output from the command
        will be logged to the minion log. However, there are some cases where
        programs use the return code for signaling and a nonzero exit code
        doesn't necessarily mean failure. Pass this argument as ``True`` to
        skip logging the output if the command has a nonzero exit code.

    :param str runas: Specify an alternate user to run the command. The default
        behavior is to run as the user under which Salt is running. If running
        on a Windows minion you must also use the ``password`` argument, and
        the target user account must be in the Administrators group.

        .. warning::

            For versions 2018.3.3 and above on macosx while using runas,
            to pass special characters to the command you need to escape
            the characters on the shell.

            Example:

            .. code-block:: bash

                cmd.run_bg 'echo '\''h=\"baz\"'\''' runas=macuser

    :param str password: Windows only. Required when specifying ``runas``. This
        parameter will be ignored on non-Windows platforms.

        .. versionadded:: 2016.3.0

    :param str shell: Specify an alternate shell. Defaults to the system's
        default shell.

    :param bool python_shell: If False, let python handle the positional
        arguments. Set to True to use shell features, such as pipes or
        redirection.

    :param dict env: Environment variables to be set prior to execution.

        .. note::
            When passing environment variables on the CLI, they should be
            passed as the string representation of a dictionary.

            .. code-block:: bash

                salt myminion cmd.run_bg 'some command' env='{"FOO": "bar"}'

    :param bool clean_env: Attempt to clean out all other shell environment
        variables and set only those provided in the 'env' argument to this
        function.

    :param str prepend_path: $PATH segment to prepend (trailing ':' not
        necessary) to $PATH

        .. versionadded:: 2018.3.0

    :param str template: If this setting is applied then the named templating
        engine will be used to render the downloaded file. Currently jinja,
        mako, and wempy are supported.

    :param str umask: The umask (in octal) to use when running the command.

    :param int timeout: A timeout in seconds for the executed process to return.

    .. warning::

        This function does not process commands through a shell unless the
        ``python_shell`` argument is set to ``True``. This means that any
        shell-specific functionality such as 'echo' or the use of pipes,
        redirection or &&, should either be migrated to cmd.shell or have the
        python_shell=True flag set here.

        The use of ``python_shell=True`` means that the shell will accept _any_
        input including potentially malicious commands such as 'good_command;rm
        -rf /'.  Be absolutely certain that you have sanitized your input prior
        to using ``python_shell=True``.

    :param list success_retcodes: This parameter will be allow a list of
        non-zero return codes that should be considered a success.  If the
        return code returned from the run matches any in the provided list,
        the return code will be overridden with zero.

      .. versionadded:: 2019.2.0

    :param bool stdin_raw_newlines: False
        If ``True``, Salt will not automatically convert the characters ``\\n``
        present in the ``stdin`` value to newlines.

      .. versionadded:: 2019.2.0

    CLI Example:

    .. code-block:: bash

        salt '*' cmd.run_bg "fstrim-all"

    The template arg can be set to 'jinja' or another supported template
    engine to render the command arguments before execution.
    For example:

    .. code-block:: bash

        salt '*' cmd.run_bg template=jinja "ls -l /tmp/{{grains.id}} | awk '/foo/{print \\$2}'"

    Specify an alternate shell with the shell parameter:

    .. code-block:: bash

        salt '*' cmd.run_bg "Get-ChildItem C:\\ " shell='powershell'

    If an equal sign (``=``) appears in an argument to a Salt command it is
    interpreted as a keyword argument in the format ``key=val``. That
    processing can be bypassed in order to pass an equal sign through to the
    remote shell command by manually specifying the kwarg:

    .. code-block:: bash

        salt '*' cmd.run_bg cmd='ls -lR / | sed -e s/=/:/g > /tmp/dontwait'
    u	__pub_jiduRoRmRnR�R�R�R�R�R�RR�RwRRGRXR�R�R@R�R�R�R�RHR�R�upidN(RRRRRR(RFRGRR�RwRRXR�R@R�R�R�R�R�R�R�RHR�R�R�R?tres((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pytrun_bgus>�		(kt__doc__t
__future__RRRR�R R�R!R!R�R�R�R�RaRjRSRtsalt.utils.argsR0tsalt.utils.datatsalt.utils.filestsalt.utils.jsontsalt.utils.pathtsalt.utils.platformtsalt.utils.powershelltsalt.utils.stringutilstsalt.utils.templatestsalt.utils.timed_subprocesstsalt.utils.usertsalt.utils.versionst
salt.utils.vttsalt.utils.win_dacltsalt.utils.win_regtsalt.grains.extratsalt.extRtsalt.exceptionsRRRtsalt.logRtsalt.ext.six.movesRR	R
R�R�tImportErrorR1R�R�tsalt.utils.win_runasRR�tsalt.utils.win_functionsRR�RR�R
Rt__proxyenabled__Rt	getLoggert__name__RtgrainstextraRwR�RRRR.RRKRSRYRCRfR�RR
RR�RRRRRR)R*R+R�R-R1R.R:R?R�RCReR4R{R}(((s7/usr/lib/python2.7/site-packages/salt/modules/cmdmod.pyt<module>s8
				
		4	
		��@ ��������	
	
	
)�		���B

Zerion Mini Shell 1.0