Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/vars/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/vars/manager.pyc

�
�Udac@`sddlmZmZmZeZddlZddlZddlm	Z	yddl
mZWn!ek
r�ddl
m
ZnXddlmZddlmZddlmZmZmZmZmZmZdd	lmZdd
lmZmZddlm Z m!Z!ddl"m#Z#m$Z$m%Z%dd
l&m'Z'm(Z(m)Z)ddl*m+Z+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6m7Z7m8Z8ddl9m:Z:ddl;m<Z<m=Z=e2�Z>d�Z?ddd��YZ@dS(i(tabsolute_importtdivisiontprint_functionN(tdefaultdict(tsha1(tsha(tUndefinedError(t	constants(tAnsibleErrortAnsibleParserErrortAnsibleUndefinedVariabletAnsibleFileNotFoundtAnsibleAssertionErrortAnsibleTemplateError(tHost(tsort_groupstget_group_vars(tto_bytestto_text(tMappingtMutableMappingtSequence(t	iteritemst	text_typetstring_types(t
lookup_loadertvars_loader(t	FactCache(tTemplar(tDisplay(tlistify_lookup_plugin_terms(tcombine_varstload_extra_varstload_options_vars(twrap_var(tnamespace_factstclean_factscC`st|dkrdSt|t�s+|g}n|}x<|D]4}t|t�s8td|t|�f��q8q8W|S(s�
    Ensures that vars contained in the parameter passed in are
    returned as a list of dictionaries, to ensure for instance
    that vars loaded from a file conform to an expected state.
    sevariable files must contain either a dictionary of variables, or a list of dictionaries. Got: %s (%s)N(tNonet
isinstancetlistRRttype(tatdatatitem((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pytpreprocess_vars5s
#tVariableManagerc	B`s�eZedddddddg�Zeeed�Zd�Zd	�Zed
��Z	d�Z
eeeeeeeed�Zeed
�Z
d�Zd�Zd�Zd�Zd�ZRS(tplugins_by_grouptgroups_plugins_playtgroups_plugins_inventorytgroups_inventorytall_plugins_playtall_plugins_inventoryt
all_inventorycC`s"tt�|_tt�|_tt�|_tt�|_tt�|_||_||_d|_
dttj
d��j�|_t|�|_|jjdt�}t|tkp�|�|_td|j�|_yt�|_Wn/tk
r}tjt|��i|_nXdS(Ns__omit_place_holder__%si@tbasedirtloader(Rtdictt_nonpersistent_fact_cachet_vars_cachet_extra_varst_host_vars_filest_group_vars_filest
_inventoryt_loaderR%t	_hostvarsRtosturandomt	hexdigestt_omit_tokenR!t
_options_varstgettFalsetbooltsafe_basedirR Rt_fact_cacheRtdisplaytwarningR(tselfR6t	inventorytversion_infoR5te((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyt__init__Os$			"cC`sgtd|jd|jd|jd|jd|jd|jd|jd|jd	|j	d
|j
�
}|S(Nt
fact_cachet
np_fact_cachet
vars_cachet
extra_varsthost_vars_filestgroup_vars_filest
omit_tokentoptions_varsRMRH(R7RIR8R9R:R;R<RCRDR=RH(RLR*((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyt__getstate__ms									cC`s|jdtt��|_|jdtt��|_|jdtt��|_|jdt��|_|jdtt��|_|jdtt��|_|jddt	t
jd	��j��|_
|jd
d�|_|jdt��|_|jdt�|_dS(
NRQRRRSRTRURVRWs__omit_place_holder__%si@RMRXRH(RERR7RIR8R9R:R;R<RR@RARBRCR%R=RDRFRH(RLR*((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyt__setstate__|s.cC`s|jS(N(R:(RL((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyRT�scC`s
||_dS(N(R=(RLRM((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyt
set_inventory�sc	`s�tjd�t�}	�jd|d|d|d|d|d|d|�}
g��jrp�jj�g�n|r�x,|j�D]}t|	|j	��}	q�Wn|rdt
jd	kr�|j��nJt
jd.kr�|j�dg�n%t
jd
krt
dt
j��n|jd/k	rd|s:|jt
jkrdt|	|jj	d|j���}	qdn|r��jjjd	��tg|j�D]}|jd0kr�|^q����fd����fd����fd���fd�}
��fd�}��fd�}�fd�}��fd�}��fd�}���fd�}xgt
jD]\}|�jkr�tjd||jf�t|	t�|��}	qktjd|�qkWt|	|j��}	t|	�|g��}	t|	�|g��}	y�t�jj|ji��}|	j t!|��t
j"rkt|	tt#|���}	n(t|	ti|jdi�d6��}	Wq�t$k
r�q�Xn|r!t|	|j��}	|j%�}y�x�|D]�}t|	�j&�}t||
�}t'd�jd|�}|}t(|t)�s<|g}ny�x�|D]�}|j*|�}t(|t+�s}t
d|��nyRt,�jj-|d t.��}|d/k	r�x |D]}t|	|�}	q�WnPWqFt/k
r�qFqFt0k
r��qFXqFW|rt/d!|��nWn�t1t2fk
r�|d/k	r��jj|jt��jd"�r�|d/k	r�t2d#|d$|��q�tj3d%|�q�nXtj3d&|�q�WWn-t4k
r�t0d'|t5|�f��nXt
j6s!x2|j�D]!}t|	|jd(t7��}	q�Wq!n|rr|jrZt|	|jj|j�d(t7��}	nt|	|j��}	n|r�t|	�j8j|j9�t���}	t|	�j:j|jt���}	n|r|jr�t|	|jj;|j���}	nt|	|j<��}	nt|	�j&�}	t|	|
�}	|rH|j=|	d)<n|r�|j>d/k	r�|r��j?|||	�\|	d*<|	d+<n|s�|r�|	j@�|	d,<ntjd-�|	S(1sn
        Returns the variables, with optional "context" given via the parameters
        for the play, host, and task (which could possibly result in different
        sets of variables being returned due to the additional context).

        The order of precedence is:
        - play->roles->get_default_vars (if there is a play context)
        - group_vars_files[host] (if there is a host context)
        - host_vars_files[host] (if there is a host context)
        - host->get_vars (if there is a host context)
        - fact_cache[host] (if there is a host context)
        - play vars (if there is a play context)
        - play vars_files (if there's no host context, ignore
          file names that cannot be templated)
        - task->get_vars (if there is a task context)
        - vars_cache[host] (if there is a host context)
        - extra vars

        ``_hosts`` and ``_hosts_all`` should be considered private args, with only internal trusted callers relying
        on the functionality they provide. These arguments may be removed at a later date without a deprecation
        period and without warning.
        sin VariableManager get_vars()tplaythostttasktinclude_hostvarstinclude_delegate_tot_hostst
_hosts_alltalltbottomtplaybook_dirittopsUnknown playbook vars logic: %st	dep_chainc`s�i}y|j�j||�}Wn�tk
r�yYxR|D]J}t|t�rm|j|j|j��q<|j|j|j��q<WWq�tk
r�t	|d�r�t
d|j|jf��q�t
d|j|jf��q�XnX|S(Ntruns)Cannot use v1 type vars plugin %s from %ssInvalid vars plugin %s from %s(
tget_varsR>tAttributeErrorR&Rtupdatet
get_host_varstnameRthasattrRt
_load_namet_original_path(tplugintpathtentitiesR*tentity(RL(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyt_get_plugin_vars�s

!
$c	`s�i}x��jjD]�}d|kr>tjj|�r>qn-tjjt|��sktjj|�}nx/tj	�D]!}t
|�|||��}qxWqW|S(s) merges all entities by inventory source t,(R=t_sourcesR@RrtexiststisdirRtdirnameRRcR(RsR*t
inventory_dirRq(RuRL(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyt_plugins_inventory�s#c`sMi}x@tj�D]2}x)�D]!}t|�|||��}q WqW|S(s& merges all entities adjacent to play (RRcR(RsR*RqRr(Rutbasedirs(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyt
_plugins_play�s

#c`s
�j�S(N(Ri((t	all_group(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyR4sc`s
��g�S(N(((R|R(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyR3sc`s
��g�S(N(((R~R(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyR2sc`s
t��S(s  gets group vars from inventory (R((thost_groups(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyR1	sc`s
���S(s/ gets plugin sources from inventory for groups (((R|R�(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyR0
sc`s
���S(s* gets plugin sources from play for groups (((R~R�(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyR/sc`sUi}xH�D]@}t||�|��||<t||�|��||<q
W|S(s�
                    merges all plugin sources by group,
                    This should be used instead, NOT in combination with the other groups_plugins* functions
                (R(R*tgroup(R|R~R�(s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pytplugins_by_groupss

!sCalling %s to load vars for %ss.Ignoring unknown variable precedence entry: %st
ansible_localR6t	variabless�Invalid vars_files entry found: %r
vars_files entries should be either a string type or a list of string types after template expansiontunsafesvars file %s was not foundtmodule_setupsTan undefined variable was found when attempting to template the vars_files item '%s'tobjs4skipping vars_file '%s' due to an undefined variablesRead vars_file '%s'sXError while reading vars files - please supply a list of file names. Got '%s' of type %stinclude_paramstenvironmenttansible_delegated_varst_ansible_loop_cachetvarssdone with get_vars()(RdReN(sall(ARJtdebugR7t_get_magic_variablesRHR>tget_basedirt	get_rolesRtget_default_varstCtPLAYBOOK_VARS_ROOTtget_search_pathRt_roleR%tactiont_ACTION_INCLUDE_ROLEt
get_dep_chainR=tgroupsRERt
get_groupsRmtVARIABLE_PRECEDENCEt_ALLOWEDtlocalsRKRiR"RIRkR#tINJECT_FACTS_AS_VARSR$tKeyErrortget_vars_filesR:RR&R'ttemplateRR,tload_from_filetTrueRR	RR
tvvvt	TypeErrorR(tDEFAULT_PRIVATE_ROLE_VARSRFR9tget_nameR8tget_role_paramstget_include_paramsR�tdelegate_tot_get_delegated_varstcopy(RLR\R]R^R_R`t	use_cacheRaRbtall_varstmagic_variablestroletgR4R3R2R1R0R/R�tentrytfactst
vars_filestvars_file_itemt	temp_varsttemplartvars_file_listt	vars_fileR*R+((RuR|R~RR}R�RLs8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyRi�s�
				'*4

	,






<
	%	*''	$&
cC`si}tjj|jj��|d<tj|d<|r�ttg|j	D]%}	|	j
�D]}
|
j�^qXqH��}g|j	D]}	|	j�^q�}tt||��|d<||d<||d<|d|d<|j�|d<n|ra|jra|jjdt
�|d	<|jj|d
<t|jj�|d<|jj|d<|jj�|d
<qan|jdk	r�|jj�|d<|r�td|j�}
|
j|j�r�d}n|jp�d}|s�g|jjd|dt�D]}|j^q�}n|s-g|jj�D]}|j^q}n||d<g|dD]}||jkrC|^qC|d<g|D]}||jkro|^qo|d<|d|d<q�n|j|d<x't|j�D]\}}|||<q�W|jdk	r|r|j|d<n|S(s�
        Returns a dictionary of so-called "magic" variables in Ansible,
        which are special variables we set internally for use.
        Retansible_playbook_pythontansible_role_namestansible_play_role_namestansible_dependent_role_namest
role_namestansible_play_nametinclude_role_fqcnt	role_namet	role_patht	role_uuidtansible_collection_nametansible_role_nameR�R6Rctpatterntignore_restrictionstansible_play_hosts_alltansible_play_hoststansible_play_batcht
play_hoststomitthostvarsN( R@RrtabspathR>R�tsyst
executableR'tsettrolestget_all_dependenciesR�R�RFt
_role_pathRt_uuidt_role_collectionR=R%tget_groups_dictRtis_templatethostst	get_hostsR�Rmt_removed_hostsRCRRDR?(RLR\R]R^R_R`RaRbR�trtdtdependency_role_namestplay_role_namesR�R�thtxtoptiontoption_value((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyR��sN
A"

		4(0,
cC`sOt|d�sidfS|j�}td|jd|�}g}t}|jdk	r|jtkr�yjtd|j	d|d|jdtdt
�}ttj|jd|jd|�j
d|d|��}Wqtk
r�dg}qXq[td|j��nT|j	dk	rLy|j|j	�}Wq[tk
rHdg}q[Xnt
}dg}t�}	t|jd	d
�}
t
}x�|D]�}|dk	r�|||
<n||_|j|jdt
�}
|
|jkr�t}n|
dkrtddd
|j��nt|
t�s9tddt|
�d
|j��n|
|	krKq�nd}|jdk	r�|jj|
�}|dkr�xN|jjdtdt�D]}|j|
kr�|}Pq�q�Wtd|
�}q�ntd|
�}|jd|d|d|dt
dt�|	|
<|jd�|	|
d<q�Wd}|rE|rE|}n|	|fS(NtloopR6R�ttermsR�tfail_on_undefinedtconvert_baresDFailed to find the lookup named '%s' in the available lookup pluginstloop_varR+tmessages$Undefined delegate_to host for task:R�s^the field 'delegate_to' has an invalid type (%s), and could not be converted to a string type.t
ignore_limitsR�RmR\R]R^R`R_tinventory_hostname( RnR%R�RR>R�t	loop_withRRR�RFR"RERhR
RR�R7tgetattrtloop_controltavailable_variablesR�t_dsR&RR(R=tget_hostR�taddressRRi(RLR\R^texisting_variablest	vars_copyR�titemsthas_loopt
loop_termstdelegated_host_varstitem_vartcache_itemsR+tdelegated_host_nametdelegated_hostR�R�((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyR��sx
=

		

			"	
	cC`s|jj|d�dS(s-
        Clears the facts for a host
        N(RItpopR%(RLthostname((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pytclear_facts_scC`s�t|t�s(tdt|���ny|j|}Wntk
rR|}n>Xt|t�s�tdj|t|����n|j	|�||j|<dS(sO
        Sets or updates the given facts for a host in the fact cache.
        sIthe type of 'facts' to set for host_facts should be a Mapping but is a %ssCThe object retrieved for {0} must be a MutableMapping but was a {1}N(
R&RRR(RIR�RR�tformatRk(RLR]R�t
host_cache((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pytset_host_factses

	
cC`set|t�s(tdt|���ny|j|j|�Wntk
r`||j|<nXdS(sO
        Sets or updates the given facts for a host in the fact cache.
        sRthe type of 'facts' to set for nonpersistent_facts should be a Mapping but is a %sN(R&RRR(R8RkR�(RLR]R�((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pytset_nonpersistent_facts|s
cC`s�||jkr"t�|j|<n||j|kr�t|j||t�r�t|t�r�t|j|i||6�|j|<n||j||<dS(s<
        Sets a value in the vars_cache for a host.
        N(R9R7R&RR(RLR]tvarnametvalue((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pytset_host_variable�s
<'(t__name__t
__module__t	frozensetR�R%RPRYRZtpropertyRTR[R�RiR�R�R�RRR(((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyR-Js 			�%G	d			
((At
__future__RRRR(t
__metaclass__R@R�tcollectionsRthashlibRtImportErrorRtjinja2.exceptionsRtansibleRR�tansible.errorsRR	R
RRR
tansible.inventory.hostRtansible.inventory.helpersRRtansible.module_utils._textRRt/ansible.module_utils.common._collections_compatRRRtansible.module_utils.sixRRRtansible.plugins.loaderRRtansible.vars.fact_cacheRtansible.templateRtansible.utils.displayRtansible.utils.listifyRtansible.utils.varsRR R!tansible.utils.unsafe_proxyR"tansible.vars.cleanR#R$RJR,R-(((s8/usr/lib/python2.7/site-packages/ansible/vars/manager.pyt<module>s6
.		

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