Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/playbook/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/playbook/task.pyo

�
�Udac@`s�ddlmZmZmZeZddlZddlmZ	ddl
mZmZm
Z
mZddlmZddlmZmZddlmZddlmZmZdd	lmZdd
lmZddlmZddlm Z dd
l!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0dgZ1e.�Z2dee$e*e"fd��YZ3dS(i(tabsolute_importtdivisiontprint_functionN(t	constants(tAnsibleErrortAnsibleParserErrortAnsibleUndefinedVariabletAnsibleAssertionError(t	to_native(t	iteritemststring_types(tModuleArgsParser(tAnsibleBaseYAMLObjecttAnsibleMapping(t
lookup_loader(tFieldAttribute(tBase(tBlock(tCollectionSearch(tConditional(tLoopControl(tRole(tTaggable(tAnsibleCollectionLoader(tDisplay(tSentineltTaskcB`soeZdZeddde�Zedd�Zedddddd�Zedd	de�Z	edddd
�Z
edd�Zedd�Zedd	de�Z
e�Zeddd
ede�Zedd	�Zedddej�Zeddde�Zedddd�Zedd	de�Zedddede�Zd-d-d-d�Zd�Zed�Zd�Ze d-d-d-d-d-d��Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d �Z+d!�Z,d"�Z-d#�Z.eed$�Z/d%�Z0d&�Z1d'�Z2eed(�Z3d)�Z4d*�Z5d+�Z6d,�Z7RS(.s�
    A task is a language feature that represents a call to a module, with given arguments and other parameters.
    A handler is a subclass of a task.

    Usage:

       Task.load(datastructure) -> Task
       Task.something(...)
    tisatdicttdefaulttstringtintitaliastasynctlistitbooltclasst
class_typetinherittstaticitprivatecC`sD||_d|_|r$||_n	||_tt|�j�dS(sQ constructors a task, without the Task.load classmethod, it will be pretty blank N(t_roletNonet_parenttsuperRt__init__(tselftblocktrolettask_include((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR-[s			cC`s�d}t|d�rXt|jd�rXt|jd�rXd|jj|jjf}npt|jjd�r�t|jjjd�r�t|jjjd�r�d|jjjj|jjjjf}n|S(s; return the absolute path of the task with its line number tt_dst_data_sourcet_line_numbers%s:%s(thasattrR3R4R5R+t_play(R.tpath((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pytget_pathhs3E+cC`s�|jr!|jjd|�}n|jrS|jrS||jkrSd||jfS|jrc|jS|jr}d||jfSd|jfSdS(s return the name of the task tinclude_role_fqcns%s : %ss%sN(R)tget_nametnametaction(R.R:t	role_name((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR;rs	!		cC`s�|dkrdSt|t�r#|St|t�r�d}xCt|�D]5\}}|jd�rfqEn|d||f}qEW|j�}|SdS(NR2t_s%s=%s (R*t
isinstanceR
RR	t
startswithtstrip(R.tdstbuftktv((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt	_merge_kv�scC`s4td|d|d|�}|j|d|d|�S(NR/R0R1tvariable_managertloader(Rt	load_data(tdataR/R0R1RHRItt((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pytload�scC`s6|j�tjkr$d|jdSd|j�SdS(s5 returns a human readable representation of the task sTASK: meta (%s)t_raw_paramssTASK: %sN(R;tCt_ACTION_METAtargs(R.((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt__repr__�scC`s�|jdd�}|jd�dk	s<|jd�dk	rUtd|d|��n|dkrztd|d|��n||d<||d<dS(	s2 take a lookup plugin name and store it correctly twith_R2tloopt	loop_withsduplicate loop in task: %stobjs&you must specify a value when using %sN(treplacetgetR*R(R.RCtnew_dsRERFt	loop_name((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt_preprocess_with_loop�s*
c
C`szt|t�s.td|t|�f��nt�}t|t�rU|j|_nt�j}|j	d|j
�}|dkr�g}nt|t�r�|g}n|r�|j
r�|r�||kr�|jd|�q�q�|g}n|rd|krd|kr|jd�n|r+||d<ntd|d|�}y|j�\}}}Wn@tk
r�}	|	jrz�ntt|	�d|d	|	��nX|tjkr�d
|kr�|j	dd�dkr�td
d|��n|jd
�|d<q�n||d<||d<||d<d|krI|jd|j	d��|d<n
t�|d<xt|�D]�\}
}|
dksc|
|ksc|
dkr�qcqc|
jd�r�|
jdd�tkr�|j|||
|�qc|tjkr*|
|j kr*|
|j!kr*t"j#ddd�||d|
<qctj$sB|
|j krO|||
<qct"j%d|
�qcWt&t'|�j(|�S(sg
        tasks are especially complex arguments so need pre-processing.
        keep it short.
        s%ds (%s) should be a dict but was a %stcollectionsisansible.builtinsansible.legacyttask_dstcollection_listRVtorig_exctcmdRNR2s{The 'cmd' argument cannot be used when other raw parameters are specified. Please put everything in one or the other place.R=RQtdelegate_totvarstlocal_actiontshellRSs�Specifying include variables at the top-level of the task is deprecated. Please see:
https://docs.ansible.com/ansible/playbooks_roles.html#task-include-files-and-encouraging-reuse

 for currently supported syntax regarding included files and variablestversions2.12sIgnoring invalid attribute: %sN(sactionRcsargssdelegate_to()R@RRttypeR
Rtansible_posRtdefault_collectionRXR\R*R
R)tinserttappendRtparseRt_objRROt_ACTION_HAS_CMDRtpopt
_load_varsR	RARWRR[t_ACTION_INCLUDEt_valid_attrstDEPRECATED_ATTRIBUTEStdisplayt
deprecatedtINVALID_TASK_ATTRIBUTE_FAILEDtwarningR,Rtpreprocess_data(R.RCRYRhtcollections_listtargs_parserR=RQRateRERF((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyRw�sh		
	"	


"
$'-
cC`sFt|t�s$tdd|��ntjd|d|jd|j�S(Ns|the `loop_control` value must be specified as a dictionary and cannot be a variable itself (though it can contain variables)RVRKRHRI(R@RRRRMt_variable_managert_loader(R.tattrRC((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt_load_loop_controls
cC`sIytt|�j|�Wn(tk
rD}|jd7_|�nXdS(Nsb
This error can be suppressed as a warning using the "invalid_task_attribute_failed" configuration(R,Rt_validate_attributesRtmessage(R.RCRz((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyRs
cC`sE|jr|jj|�nt�jr+ntt|�j|�dS(s�
        Override of base class post_validate, to also do final validation on
        the block and task include (if any) to which this task belongs.
        N(R+t
post_validateRRhR,R(R.ttemplar((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR�s
	cC`s|S(s�
        Override post validation for the loop field, which is templated
        specially in the TaskExecutor class when evaluating loops.
        ((R.R}tvalueR�((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt_post_validate_loop-sc`si�|dk	r���fd�}t|t�r�x�|D]}t|t�rwxg|D]}||||�qYWq=�j|dt�}t|t�r��j|�q=tjd|�q=Wqt|t�rt��x7|D]}||||�q�Wq�j|dt��n�S(su
        Override post validation of vars on the play, as we don't want to
        template these too early.
        c`sty�j|dt��|<WnPtk
ro}t|�}�jtjkrYd|ksed|kridS�nXdS(Ntconvert_baresansible_facts.envtansible_env(ttemplatetFalseRRR=ROt_ACTION_FACT_GATHERING(RERFRzterror(tenvR.R�(s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt
_parse_env_kv<s*R�s/could not parse environment value, skipping: %sN(	R*R@R"RR�R�tupdateRsRv(R.R}R�R�R�tenv_itemREtisdict((R�R.R�s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt_post_validate_environment4s$


	
cC`s|S(s�
        changed_when is evaluated after the execution of the task is complete,
        and should not be templated during the regular post_validate step.
        ((R.R}R�R�((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt_post_validate_changed_when]scC`s|S(s�
        failed_when is evaluated after the execution of the task is complete,
        and should not be templated during the regular post_validate step.
        ((R.R}R�R�((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt_post_validate_failed_whendscC`s|S(s�
        until is evaluated after the execution of the task is complete,
        and should not be templated during the regular post_validate step.
        ((R.R}R�R�((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt_post_validate_untilkscC`skt�}|jr+|j|jj��n|j|j�d|krQ|d=nd|krg|d=n|S(Nttagstwhen(RR+R�tget_varsRb(R.tall_vars((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR�rs		

cC`sTt�}|jr+|j|jj��n|jtjkrP|j|j�n|S(N(RR+R�tget_include_paramsR=ROt_ACTION_ALL_INCLUDESRb(R.R�((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR��s		cC`sntt|�j�}d|_|jrI|rI|jjd|�|_nd|_|jrj|j|_n|S(Nt
exclude_tasks(R,RtcopyR*R+R)(R.texclude_parentR�tnew_me((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR��s			cC`s�tt|�j�}|jr}|jr}|jr[|jj�|d<|jjj|d<n|jr}|jj�|d<q}n|S(Ntparenttparent_typeR0(	R,Rt	serializet	_squashedt
_finalizedR+t	__class__t__name__R)(R.RK((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR��s		c	C`sddlm}ddlm}|jdd�}|r�|jd�}|dkr_t�}n0|dkrw|�}n|dkr�|�}n|j|�||_|d=n|jd	�}|r�t	�}|j|�||_
|d	=ntt|�j|�dS(
Ni(tTaskInclude(tHandlerTaskIncludeR�R�RR�R�R0(
tansible.playbook.task_includeR�t%ansible.playbook.handler_task_includeR�RXR*RtdeserializeR+RR)R,R(	R.RKR�R�tparent_dataR�tpt	role_datatr((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR��s*
	
	
	
cC`s)||_|jr%|jj|�ndS(s�
        Sets the loader on this object and recursively on parent, child objects.
        This is used primarily after the Task has been serialized/deserialized, which
        does not preserve the loader.
        N(R|R+t
set_loader(R.RI((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR��s		cC`s|j|j}|j|j}y�|j|}t|jdt�rQ|j}n|jj}|r�|tksu|r�t|dt�r�|dkr�t|d�r�|j	|�}n|jj
|t�}|r�|j|||�}q�|}q�nWntk
rnX|S(sZ
        Generic logic to get the attribute or parent attribute for a task value.
        tstatically_loadedRbt_get_parent_attribute(
Rqtextendtprependt_attributestgetattrR+tTrueRR6R�RXt
_extend_valuetKeyError(R.R}R�R�R�R+tparent_value((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR��s$

cC`s|jr|jj�SdSdS(N(R+t
get_dep_chainR*(R.((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR��s	
cC`s|g}|j�}|rD|jtg|D]}|j^q(��ntjj|j��}||krx|j|�n|S(s�
        Return the list of paths you should search for files, in order.
        This follows role/playbook dependency chain.
        (	R�R�treversedt
_role_pathtosR8tdirnameR9Rj(R.t
path_stackt	dep_chaintxttask_dir((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pytget_search_path�s,cC`s|jr|jj�StS(N(R+tall_parents_staticR�(R.((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR�s	
cC`sCddlm}|jr?t|j|�r2|jS|jj�SdS(Ni(R�(R�R�R+R@tget_first_parent_includeR*(R.R�((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR�	s	
N(8R�t
__module__t__doc__RRt_argst_actiont
_async_valR"t
_changed_whent_delayt_delegate_tot_delegate_factst_failed_whent_loopRR�t
_loop_controlt_notifyROtDEFAULT_POLL_INTERVALt_pollR�t	_registert_retriest_untilt
_loop_withR*R-R9R;RGtstaticmethodRMRRR[RwR~RR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyR0sZ

	
	
				f	
				)					
	
		!			(4t
__future__RRRRft
__metaclass__R�tansibleRROtansible.errorsRRRRtansible.module_utils._textRtansible.module_utils.sixR	R
tansible.parsing.mod_argsRtansible.parsing.yaml.objectsRR
tansible.plugins.loaderRtansible.playbook.attributeRtansible.playbook.baseRtansible.playbook.blockRt!ansible.playbook.collectionsearchRtansible.playbook.conditionalRtansible.playbook.loop_controlRtansible.playbook.roleRtansible.playbook.taggableRtansible.utils.collection_loaderRtansible.utils.displayRtansible.utils.sentinelRt__all__RsR(((s9/usr/lib/python2.7/site-packages/ansible/playbook/task.pyt<module>s."		

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