Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/plugins/shell/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyo

�
�Udac@`s�ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddlmZddlmZddlmZe	jd�Zd	efd
��YZdS(i(tabsolute_importtdivisiontprint_functionN(tAnsibleError(t	text_type(tshlex_quote(t	to_native(t
AnsiblePlugins^~[_.A-Za-z0-9][-_.A-Za-z0-9]*$t	ShellBasecB`s�eZd�Zd�Zdddd�Zed��Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zed�Zd�Zded
dd�Zdd�Zd�Zdd�Zd�Zd�Zd�ZRS(cC`s2tt|�j�i|_d|_d|_dS(N(tsuperRt__init__tenvtNonettmpdirt
executable(tself((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyR
$s		cC`ssg|jd�D]}|jd�^q}td�|D��s_tdjt|����n|jd|�dS(Ntsystem_tmpdirst/cs`s!|]}tjj|�VqdS(N(tostpathtisabs(t.0td((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pys	<genexpr>4ss`The configured system_tmpdirs contains a relative path: {0}. All system_tmpdirs must be absolute(t
get_optiontrstriptallRtformatRt
set_option(RRtnormalized_paths((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyt_normalize_system_tmpdirs,s
+	cC`s�tt|�jd|d|d|�|jd�}t|t�rgx1|D]}|jj|�qJWn|jj|�y|j�Wnt	k
r�nXdS(Nt	task_keystvar_optionstdirecttenvironment(
R	Rtset_optionsRt
isinstancetlistRtupdateRtKeyError(RRRR Rtenv_dict((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyR":s%

cC`s)dtj�tj�tjdd�fS(Nsansible-tmp-%s-%s-%siii0I(ttimeRtgetpidtrandomtrandint(((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyt_generate_temp_dir_nameNscK`sBdjg|j�D](\}}d|tt|��f^q�S(Nt s%s=%s(tjointitemsRR(Rtkwargstktv((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyt
env_prefixRscG`stjj|�S(N(RRR.(Rtargs((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyt	join_pathUscC`s"tjj|j��}|j�S(N(RRtbasenametstrip(Rtpathnamet	base_name((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytget_remote_filenameYscC`s
|jd�S(NR(tendswith(RR((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytpath_has_trailing_slash]scC`sEd|g}|j|�g|D]}t|�^q }dj|�S(NtchmodR-(textendRR.(Rtpathstmodetcmdtc((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyR=`s
cC`sEd|g}|j|�g|D]}t|�^q }dj|�S(NtchownR-(R>RR.(RR?tuserRARB((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyRCgs
cC`sRddd||fg}|j|�g|D]}t|�^q-}dj|�S(s5Only sets acls for users as that's really all we needtsetfacls-msu:%s:%sR-(R>RR.(RR?RDR@RARB((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyt
set_user_faclns
cC`s:t|�}d}|r%|d7}n|d||jfS(Nsrm -f s-r s%s %s(Rt_SHELL_REDIRECT_ALLNULL(RRtrecurseRA((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytremovevs

cC`s"ddt|�g}dj|�S(Nttests-eR-(RR.(RRRA((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytexists}si�c	C`s<|s|jj�}n|rj|r6|jd�}n||jd�krT|}q�|jd�d}n$|dkr�|jd�}n|}|j||�}d|j||jf}|d|j|j||jf7}|d|j||j||jf7}|r8d|@}d	|j	||j||j
f}n|S(
NRRit
remote_tmpsmkdir -p %s echo %s %ss%s mkdir %s echo %s %ss %s echo %s=%s echo %s %si�s%s umask %o %s %s %s(t	__class__R,RRRR5t_SHELL_SUB_LEFTt_SHELL_SUB_RIGHTt
_SHELL_ANDt_SHELL_GROUP_LEFTt_SHELL_GROUP_RIGHT(	RtbasefiletsystemR@R
t
basetmpdirtbasetmpRAt	tmp_umask((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytmkdtemp�s&	#&%tcC`sH|dkr-tj|�s@t|�}q@n|r@||7}nd|S(s� Return a command to expand tildes in a path

        It can be either "~" or "~username". We just ignore $HOME
        We use the POSIX definition of a username:
            http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_426
            http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap03.html#tag_03_276

            Falls back to 'current workind directory' as we assume 'home is where the remote user ends up'
        t~secho %s(t_USER_HOME_PATH_REtmatchR(Rtuser_home_pathtusername((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytexpand_user�s
cC`sd|j|jfS(s-Return the working directory after connectingsecho %spwd%s(RNRO(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytpwd�scC`s�|j�dkr!t|�}ng}|rH|jdd�j�}nd}|j|j�||g�|dk	r�|j|�ndj|�}|S(NRYs#!R-(R7RtreplaceR>RtappendR.(Rt
env_stringtshebangRAtarg_patht	cmd_partstnew_cmd((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytbuild_module_command�scC`s'|jr#|d|j|f7}n|S(s6Append an additional command if supported by the shells %s %s(RP(RRAt
cmd_to_append((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytappend_command�s	cC`s|S(s_wrap script execution with any necessary decoration (eg '&' for quoted powershell script paths)((RRA((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyt
wrap_for_exec�scC`s
t|�S(s[Returns a shell-escaped string that can be safely used as one token in a shell command line(R(RRA((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pytquote�sN(t__name__t
__module__R
RRR"tstaticmethodR,R3R5R:R<R=RCRFtFalseRIRKRXR_R`RhRjRkRl(((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyR#s(										*			(t
__future__RRRttypet
__metaclass__Rtos.pathR*treR(tansible.errorsRtansible.module_utils.sixRtansible.module_utils.six.movesRtansible.module_utils._textRtansible.pluginsRtcompileR[R(((sB/usr/lib/python2.7/site-packages/ansible/plugins/shell/__init__.pyt<module>s

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]