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/base.pyc

�
�Udac@`s�ddlmZmZmZeZddlZddlZddlmZ	ddl
mZddlm
Z
ddlmZddlmZddlmZmZmZdd	lmZdd
lmZmZmZddlmZmZddlm Z m!Z!dd
l"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)m*Z*m+Z+e%�Z,d�Z-d�Z.d�Z/d�Z0d�Z1defd��YZ2dee2e3�fd��YZ4de4fd��YZ5dS(i(tabsolute_importtdivisiontprint_functionN(tcopy(tpartial(tUndefinedError(t	constants(tcontext(t	iteritemststring_typestwith_metaclass(tboolean(tAnsibleParserErrortAnsibleUndefinedVariabletAnsibleAssertionError(tto_textt	to_native(t	AttributetFieldAttribute(t
DataLoader(tDisplay(tSentinel(tcombine_varstisidentifiert
get_unique_idcC`say|j|}Wn-tk
r@td|jj|f��nX|tkr]|j|}n|S(Ns!'%s' object has no attribute '%s'(t_attributestKeyErrortAttributeErrort	__class__t__name__Rt_attr_defaults(t	prop_nametselftvalue((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt
_generic_gs
 cC`sfy2|jr|j|Sd|}t||��SWn-tk
ratd|jj|f��nXdS(Ns_get_attr_%ss!'%s' object has no attribute '%s'(t	_squashedRtgetattrRRRR(RR tmethod((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt_generic_g_method+s	

cC`s�yZ|js|jr%|j|}n4y|j|�}Wntk
rX|j|}nXWn-tk
r�td|jj|f��nX|tkr�|j	|}n|S(Ns!'%s' object has no attribute '%s'(
R#t
_finalizedRt_get_parent_attributeRRRRRR(RR R!((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt_generic_g_parent5s

 cC`s||j|<dS(N(R(RR R!((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt
_generic_sGscC`s|j|=dS(N(R(RR ((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt
_generic_dKstBaseMetacB`seZdZd�ZRS(s�
    Metaclass for the Base object, which is used to construct the class
    attributes based on the FieldAttributes available.
    c`s|d����fd��i|d<i|d<i|d<i|d<�||��||�tt|�j||||�S(Nc	S`s�t|j��}xj|D]b}||}t|t�r|jd�rT|d}nd|}||ksv||kr�tt|�}nBd|ks�d|kr�|jr�tt|�}ntt	|�}tt
|�}tt|�}t|||�||<||d|<t
|d|<|j|d|<|jd	k	r{t|||�||j<||d|j<||d|j<q{qqWd	S(
s
            Helper method which creates the attributes based on those in the
            source dictionary of attributes. This also populates the other
            attributes used to keep track of these attributes and via the
            getter/setter/deleter methods.
            t_is_get_attr_%sR(t_valid_attrsRRt_alias_attrsN(tlisttkeyst
isinstanceRt
startswithRR&tinheritR)R"R*R+tpropertyRtdefaulttaliastNone(	tsrc_dicttdst_dictR1t	attr_nameR!R%tgettertsettertdeleter((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt
_create_attrsWs,



!c`scx\|D]T}t|d�r�|j|�|jj�}|j|��|j|�qqWdS(s�
            Helper method which creates attributes from all parent objects
            recursively on through grandparent objects
            t__dict__N(thasattrR@Rtupdatet	__bases__(tparentsR:tparenttnew_dst_dict(R?t_process_parents(s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyRG~s

RRR.R/(tsuperR,t__new__(tclstnameRDtdct((R?RGs9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyRIVs	'





(Rt
__module__t__doc__RI(((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyR,OstFieldAttributeBasecB`s�eZd�Zdd�Zd�Zddd�Zd�Zd�Zd�Z	d�Z
d	�Zdd
�Zd�Z
d�Zd
�Zd�Zd�Zed�Zd�Zd�Zd�Zd�ZRS(cC`s�d|_d|_t|_t|_t|_t�|_|j	j
j�|_
|j	jj�|_x<|jj
�D]+\}}t|�rs|�|j|<qsqsWt�|_dS(N(R8t_loadert_variable_managertFalset
_validatedR#R'Rt_uuidRRRRtitemstcallabletdicttvars(R tkeyR!((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt__init__�s					icC`s�|dkrtjd�ntjdd||jj|t|�f�t|d�r�|jr�|jj|d�|jj�}|r�x"|D]}|j|d�q�Wq�nt|d�r�|j	r�|j	j|d�ndS(	sf this is never called from production code, it is here to be used when debugging as a 'complex print' isEDUMPING OBJECT ------------------------------------------------------s%s- %s (%s, id=%s)t t_parentit_playN(
tdisplaytdebugRRtidRAR\tdump_met
get_dep_chainR](R tdeptht	dep_chaintdep((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyRa�s-
cC`s|S(sD infrequently used method to do some pre-processing of legacy terms ((R tds((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pytpreprocess_data�scC`s9|dkrtd|��nt|d|�||_|dk	rP||_nt�|_|j|�}|j|�x�tt	|j
�dtjd��D]�\}}|}||j
kr�|j
|}n||kr�t|d|d�}|r||||�|j|<q'|||j|<q�q�W|j�|S(s4 walk the input datastructure and assign any values s%ds (%s) should not be None but it is.t_dsRYis_load_%sN(R8RtsetattrRQRPRRgt_validate_attributestsortedRR.toperatort
itemgetterR/R$Rtvalidate(R Rftvariable_managertloaderRKtattrttarget_nameR%((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt	load_data�s(	
1
cC`s*yt|d�SWntk
r%dSXdS(NRh(R$RR8(R ((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pytget_ds�s
cC`s|jS(N(RP(R ((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt
get_loader�scC`s|jS(N(RQ(R ((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pytget_variable_manager�scC`sn|j|�}td	�}|rjt|t�rj||krjtd|dj|�fd|j���n|S(
Ntalwayst	on_failedton_unreachablet
on_skippedtnevers9'%s' is not a valid value for debugger. Must be one of %ss, tobj(salwaysRxRyRzR{(ttemplatet	frozensetR2R	RtjoinRt(R RqR!ttemplartvalid_values((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt_post_validate_debuggers
!.cC`s[t|jj��}x?|D]7}||krtd||jjfd|��qqWdS(s}
        Ensures that there are no keys in the datastructure which do
        not map to attributes for this object.
        s&'%s' is not a valid attribute for a %sR|N(R~R.R1RRR(R Rftvalid_attrsRY((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyRjs
cC`s|dkrin|}|jsx�t|j�D]�\}}||jkr\|j|}nt|d|d�}|r�|||t||��q1|j|}|dk	r1|jdkr�t|t	t
f�r�td|t|�fd|j
���q�q1q1Wnt|_dS(s6 validation that is done at parse time, not load time s_validate_%ststrings[The field '%s' is supposed to be a string type, however the incoming data structure is a %sR|N(R8RSRR.R/R$RtisaR2R0RWRttypeRttTrue(R tall_varsRKt	attributeR%R!((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyRns	
$/cC`sI|jsEx-|jj�D]}t||�|j|<qWt|_ndS(s�
        Evaluates all attributes and sets them to the evaluated version,
        so that all future accesses of attributes do not need to evaluate
        parent attributes.
        N(R#R.R1R$RR�(R RK((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pytsquash.s	cC`s�|j�}x`|jj�D]O}||jkr7qnt|j|�|j|<t|j|�|j|<qW|j|_|j|_|j	|_	|j
|_
|j|_t|d�r�|j
|_
n|S(s=
        Create a copy of this object and return it.
        Rh(RR.R1R/tshallowcopyRRRPRQRSR'RTRARh(R tnew_meRK((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyR9scC`s|jdkrt|�}n�|jdkr<t|�}n�|jdkrZt|�}n�|jdkr~t|dt�}n�|jdkr�t|t�r�d|kr�|jdd�}nt|�}n5|jd	kr�|dkr�g}nt|t
�s|g}n|jdk	rx�|D]�}t||j�smtd
||j|t
|�fd|j���q!|jr!|jtkr!|dks�|j�dkr�td|fd|j���q�q!q!Wqn/|jd
kr\|dkr�t�}nBt|t
tf�s;t|t�r/|jd�}q;|g}nt|t�st|�}qn�|jdkr�|dkr�t�}qt|t�std|��qnY|jdkrt||j�s�td||jt
|�f��n|jd|�n|S(NR�tinttfloattbooltstricttpercentt%tR0s@the field '%s' should be a list of %s, but the item '%s' is a %sR|s8the field '%s' is required, and cannot have empty valuestsett,RWs%s is not a dictionarytclasss'%s is not a valid %s (got a %s instead)R�(R�RR�R�RRRR2R	treplaceR8R0tlistofRR�RttrequiredtstripR�tsplitRWt	TypeErrort
class_typet
post_validate(R RKR�R!R�titem((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pytget_validated_valueRsX	
./%c		C`s�|jjd�}x�t|j�D]�\}}|jr�t||�}|dkr"|j|�r"tjd||f�q"q"nt||�dkr�|j
s�q"q�td|��n"|jr�|j
jdkr�q"nyt|d|d�}|r||t||�|�}n9|jd	kr8t||�}n|jt||��}|dk	r�||kr�t|j�r�t|||j��nt|||j�w"n|dk	r�|j||||�}nt|||�Wq"ttfk
r<}t||�}td
|||j|fd|j�d|��q"ttfk
r�}|jr�|d
kr�|dkr�dt|�}nd|t|�f}t|d|j�d|��q�q"Xq"Wt|_dS(s�
        we can't tell that everything is of the right type until we have
        all the variables.  Run basic types (from isa) as well as
        any _post_validate_<foo> functions.
        tomitRXs]"%s" is not templatable, but we found: %s, it will not be templated and will be used "as is".s*the field '%s' is required but was not settTasktHandlertPlayContexts_post_validate_%sR�s_the field '%s' has an invalid value (%s), and could not be converted to an %s.The error was: %sR|torig_excRKtargssIThe task includes an option with an undefined variable. The error was: %ss\The field '%s' has an invalid value, which includes an undefined variable. The error was: %sN(svars(R�R�R�(tavailable_variablestgetRR.tstaticR$tis_templateR^twarningR8R�Rtalways_post_validateRRR�R}RVR6RiR�R�t
ValueErrorRtR
Rt_fail_on_undefined_errorsRR�R'(	R R�t
omit_valueRKR�R!R%tetmsg((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyR��sP			.)cC`s d�}y�t|t�r5||�t|j|�St|t�r�|j}x?|D]7}t|t�srt�n||�t||�}qTW|S|dkr�iSt�Wnotk
r�}td|jj	d|d|��n;t
k
r}td|jj	|fd|d|��nXdS(s�
        Vars in a play can be specified either as a dictionary directly, or
        as a list of dictionaries. If the later, this method will turn the
        list into a single dictionary.
        cS`s4x-|D]%}t|�std|��qqWdS(Ns!'%s' is not a valid variable name(RR�(RfRY((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt_validate_variable_keys�s
sIVars in a %s must be specified as a dictionary, or a list of dictionariesR|R�s2Invalid variable name in vars specified for %s: %sN(R2RWRRXR0R�R8RRRR�(R RqRfR�R�R�R�((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt
_load_vars�s*	
	
	

cC`s�t|t�s|g}nt|t�s6|g}ng|D]}|tk	r=|^q=|(g|D]}|tk	rc|^qc|(|r�||}n
||}gtj|�D]\}}|dk	r�|^q�S(s�
        Will extend the value given with new_value (and will turn both
        into lists if they are not so already). The values are run through
        a set to remove duplicate values.
        N(R2R0Rt	itertoolstgroupbyR8(R R!t	new_valuetprependtvtcombinedtiR-((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt
_extend_value�s&&

cC`sti}xgt|j�D]V\}}t||�}|jdkrbt|d�rb|j�||<q|||<qW|S(s6
        Dumps all attributes to a dictionary
        R�t	serialize(RR.R$R�RAR�(R tattrsRKR�Rq((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt
dump_attrs	scC`s�x�t|�D]�\}}||jkr
|j|}|jdkrt|t�r|j�}|j|�t|||�q�t|||�q
q
Wt|_	t|_
dS(s4
        Loads attributes from a dictionary
        R�N(RR.R�R2RWR�tdeserializeRiR�R'R#(R R�RqR!R�R|((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt
from_attrss

	cC`s7|j�}|j|d<|j|d<|j|d<|S(s0
        Serializes the object derived from the base object into
        a dictionary of values. This only serializes the field
        attributes for the object, so this may need to be overridden
        for any classes which wish to add additional items not stored
        as field attributes.
        tuuidt	finalizedtsquashed(R�RTR'R#(R trepr((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyR�+s
	


cC`s�t|t�s.td|t|�f��nx{t|j�D]j\}}||krmt||||�q>t|j�r�t|||j��q>t|||j�q>Wt|d|j	d��|j	dt
�|_|j	dt
�|_dS(s�
        Given a dictionary of values, load up the field attributes for
        this object. As with serialize(), if there are any non-field
        attribute data members, this method will need to be overridden
        and extended.
        s&data (%s) should be a dict but is a %sRTR�R�R�N(
R2RWRR�RR.RiRVR6R�RRR'R#(R tdataRKR�((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyR�=sN(RRMRZRaRgR8RsRtRuRvR�RjRnR�RR�R�R�RRR�R�R�R�R�(((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyRO�s(		-								3	I	"	
		tBasec	B`seZedddddede�Zedddejd��Zedd�Z	edddejd��Z
edd	d
ddede�Zedd
dede�Zedd
dede�Z
edd�Zedd�Zedd�Zedd�Zedddejd��Zedddejd��Zedddej�Zedddd�Zedd�Zedddejd��Zedddejd��Zedddejd��Zedddejd��Zedddejd��ZgZRS(R�R�R6R�R�R4t
connectionR�tremote_userRWtpriorityidR�R0textendR�R�tchecktdiffitbecomet
become_methodtbecome_usertbecome_flagst
become_exe(RRMRR�RRt_nameRtcliargs_deferred_gett_connectiont_portt_remote_usert_varst_module_defaultst_environmentt_no_logt	_run_oncet_ignore_errorst_ignore_unreachablet_check_modet_difftCtANY_ERRORS_FATALt_any_errors_fatalt	_throttlet	_debuggert_becomet_become_methodt_become_usert
_become_flagst_become_exetDEPRECATED_ATTRIBUTES(((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyR�Ws,!!(6t
__future__RRRR�t
__metaclass__R�RlRR�t	functoolsRtjinja2.exceptionsRtansibleRR�Rtansible.module_utils.sixRR	R
t)ansible.module_utils.parsing.convert_boolRtansible.errorsRR
Rtansible.module_utils._textRRtansible.playbook.attributeRRtansible.parsing.dataloaderRtansible.utils.displayRtansible.utils.sentinelRtansible.utils.varsRRRR^R"R&R)R*R+R,tobjectROR�(((s9/usr/lib/python2.7/site-packages/ansible/playbook/base.pyt<module>s6			
			I��

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