Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/utilities/logic/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/utilities/logic/async_wrapper.pyo

�
�Udac@`s�ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZmZejddkZejde
jje��ejejddjejd��ej�\ZZ d	�Z!d
�Z"d�Z#d�Z$d
�Z%d�Z&d�Z'e(dkr�e'�ndS(i(tabsolute_importtdivisiontprint_functionN(tto_texttto_bytesis
ansible-%ssInvoked with %st icC`stjtj|�dS(N(tsyslogt
LOG_NOTICE(tmsg((sQ/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_wrapper.pytnotice#scC`sjy,tj�}|dkr+tjd�nWn>tk
rltj�d}tjd|j|jf�nXtj�tj	t
dd��y,tj�}|dkr�tjd�nWn>tk
r�tj�d}tjd|j|jf�nXtdd�}tj|j
�tjj
��tj|j
�tjj
��tj|j
�tjj
��dS(	Niisfork #1 failed: %d (%s)
t022isfork #2 failed: %d (%s)
s	/dev/nulltw(tostforktsystexittOSErrortexc_infoterrnotstrerrortsetsidtumasktinttopentdup2tfilenotstdintstdouttstderr(tpidtetdev_null((sQ/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_wrapper.pytdaemonize_self's(
!

!cC`s/g}|j�}xdt|�D]J\}}|j�}|jd�rPd}Pq|jd�rd}PqqWtd��||}xEtt|��D]%\}}|j�j|�r�Pq�q�Wtd��|dkr|t|�|}|jdd	j	|��n|t|�| }d	j	|�|fS(
sc
    Used to filter unrelated output around module JSON output, like messages from
    tcagetattr, or where dropbear spews MOTD on every single command (which is nuts).

    Filters leading lines before first line-starting occurrence of '{' or '[', and filter all
    trailing lines after matching close character (working from the bottom of output).
    u{u}u[u]sNo start of json char foundsNo end of json char foundis2Module invocation had junk after the JSON data: %ss
(
t
splitlinest	enumeratetstript
startswitht
ValueErrortreversedtendswithtlentappendtjoin(tdatatwarningstlineststarttlinetendchartreverse_end_offsett
trailing_junk((sQ/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_wrapper.pyt_filter_non_json_linesHs*
cC`set|d��P}|jd�}|dd!dkr8dS|d|jd�!j�jd�SWdQXdS(Ntrbiiis#!s
R(RtreadtNonetindexR#tsplit(tmodule_patht	module_fdthead((sQ/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_wrapper.pyt_get_interpreterts
cC`sCytj|�Wn+tk
r>}|jtjkr?�q?nXdS(N(RtmakedirsRRtEEXIST(tpathR((sQ/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_wrapper.pyt_make_temp_dir|s
c
C`s�|d}t|d�}|jtjidd6dd6|d6��|j�tj||�t|d�}i}tjt	�tj�d}d}d}y[gt
j|�D]}	t|	d	d
�^q�}
t
|
d�}|r�||
}
ntj|
dtdtjd
tjdtj�}|j�\}}tr_|jdd�}|jdd�}nt|�\}}
tj|�}|
r�|jdg�}t|t�s�|g}n|j|
�||d<n|r�||d<n|jtj|��Wn�ttfk
rotj�d}idd6|d6t|�d6|d6|d6}||d<|jtj|��nft t!fk
r�idd6|d6|d6|d6t"j#�d6}||d<|jtj|��nX|j�tj||�dS(Ns.tmpRitstarteditfinishedtansible_job_idtterrorstsurrogate_or_stricttshellRRRsutf-8tsurrogateescapeR,tfailedtcmdRtoutdataR+($RtwritetjsontdumpstcloseRtrenametipc_notifiertsendtTruetshlexR8RR<t
subprocesstPopentFalsetPIPEtcommunicatetPY3tdecodeR3tloadstgett
isinstancetlisttextendRtIOErrorRRRR%t	Exceptiont	tracebackt
format_exc(twrapped_cmdtjidtjob_pathttmp_job_pathtjobfiletresultRKtfiltered_outdataRtcRJtinterpretertscriptt
json_warningstmodule_warningsR((sQ/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_wrapper.pyt_run_module�sn
+


.
$







cC`s�ttj�dkrFttjitd6dd6��tjd�ndtjdtj	�f}tjd}tjd}tjd	}d
tj
j|�kr�t}n1ttj�dkr�tjddk}nt}|dkr�d
||f}n|}d}tj
jdd�}tj
j|�}tj
j||�}	yt|�Wndtk
r�}
ttjidd6d|t|
�fd6ttj��d6��tjd�nXy�tj�}|rntj�d}x0|dkrtjd�r�Pq�|d}q�q�Wtd�ttjidd6dd6|d6|	d6|d6��tjj�tjd�n�tj�t�td�tj�}
|
r�tj�tj�t|�}tj |
|
�td|
|f�t!j"|�x�tj#|
tj$�d%kr�td|
|f�t!j"|�||}|dkr�td|
�tj%|
t&j'�td|
�t!j"d�|s�t(j)tj
j|�t�ntjd�q�q�Wtd �|s�t(j)tj
j|�t�ntjd�nEtd!tj	��t*|||	�td"tj	��tjd�Wntt+k
rQ�natk
r�tj,�d}
td#|
�ttjitd6d$|
d6��tjd�nXdS(&NiRIspusage: async_wrapper <jid> <time_limit> <modulescript> <argsfile> [-preserve_tmp]  Humans, do not call directly!Ris%s.%diiis-tmp-s
-preserve_tmpt_s%s %stANSIBLE_ASYNC_DIRs~/.ansible_asyncscould not create: %s - %st	exceptioniig�������?s"Return async_wrapper task started.RARBRCtresults_filet_ansible_suppress_tmpdir_deletesStarting module and watchersStart watching %s (%s)s%s still running (%s)sNow killing %ssSent kill to group %s sDone in kid B.sStart module (%s)sModule complete (%s)s	error: %ssFATAL ERROR: %s(ii(-R(RtargvtprintRMRNRSRRtgetpidR?tdirnameRWtenvironR]t
expanduserR*R@RbRRcRdR
RQROtipc_watchertpollR	RtflushR RtsetpgidttimetsleeptwaitpidtWNOHANGtkillpgtsignaltSIGKILLtshutiltrmtreeRqt
SystemExitR(Rft
time_limittwrapped_moduletargsfiletpreserve_tmpRJtstept	async_dirtjobdirRgRRtretriestsub_pidt	remaining((sQ/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_wrapper.pytmain�s�


	



(











t__main__()t
__future__RRRttypet
__metaclass__RRMRTR�RRURRcR�R�Rtmultiprocessingtansible.module_utils._textRRtversion_infoRZtopenlogR?tbasenamet__file__RR*RwtPipeR}RQR	R R3R<R@RqR�t__name__(((sQ/usr/lib/python2.7/site-packages/ansible/modules/utilities/logic/async_wrapper.pyt<module>s6'		!	,				L	�

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