Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/inventory/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/inventory/group.pyc

�
�Udac@`s�ddlmZmZmZeZddlmZddlm	Z
ddlmZddl
mZmZddlmZmZddlmZddlmZe�Zd	eed
�Zddd��YZd
S(i(tabsolute_importtdivisiontprint_function(tchain(t	constants(tAnsibleError(t	to_nativetto_text(tMappingtMutableMapping(tDisplay(tcombine_varst_cC`s�d}|r�tjj|�}|r�dtt|��t|�f}tjd
ks[|r�tjj||�}|p�tjdks�tjd|�d}q�q�tjdkr�tjd|�t	}d	}q�q�n|r�tj
|�n|S(Nts,invalid character(s) "%s" in group name (%s)tnevertignoretsilentlys
Replacing saInvalid characters were found in group names and automatically replaced, use -vvvv to see detailssNot replacing %ssWInvalid characters were found in group names but not replaced, use -vvvv to see details(Rsignore(tCtINVALID_VARIABLE_NAMEStfindallRtsettTRANSFORM_INVALID_GROUP_CHARStsubtdisplaytvvvvtTruetwarning(tnametreplacertforcetsilenttwarnt
invalid_charstmsg((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pytto_safe_group_name s""tGroupcB`s�eZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
eed�Zd	�Z
d
�Zed��Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s a group of ansible hosts cC`s[d|_t|�|_g|_d|_i|_g|_g|_d|_	d|_
dS(Nii(tdepthR"RthoststNonet_hoststvarstchild_groupst
parent_groupst_hosts_cachetpriority(tselfR((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyt__init__>s							cC`s
|j�S(N(tget_name(R-((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyt__repr__JscC`s
|j�S(N(R/(R-((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyt__str__MscC`s
|j�S(N(t	serialize(R-((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyt__getstate__PscC`s
|j|�S(N(tdeserialize(R-tdata((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyt__setstate__SscC`ssg}x$|jD]}|j|j��qWd|_td|jd|jj�d|d|j	d|j
�}|S(NRR(R*R$R%(R*tappendR2R&R'tdictRR(tcopyR$R%(R-R*tparenttresult((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyR2Vs			cC`s�|j�|jd�|_|jdt��|_|jdd�|_|jdg�|_d|_|jdg�}x4|D],}t	�}|j
|�|jj|�q�WdS(NRR(R$iR%R*(
R.tgetRR8R(R$R%R&R'R#R4R*R7(R-R5R*tparent_datatg((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyR4gs
	
	
c	`stg�}tt|���}|r7|j|�n|rk|rL|gng}|jt|���nx�|r�|j|�tg�}xYtj�fd�|D��D]8}|j|�|r�||kr�|j|�q�q�q�W|j|�|}qnW|r
|S|S(s�
        Given `rel` that is an iterable property of Group,
        consitituting a directed acyclic graph among all groups,
        Returns a set of all groups in full tree
        A   B    C
        |  / |  /
        | /  | /
        D -> E
        |  /    vertical connections
        | /     are directed upward
        F
        Called on F, returns set of (A, B, C, D, E)
        c3`s|]}t|��VqdS(N(tgetattr(t.0R>(trel(s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pys	<genexpr>�s(	RR?taddtextendtupdateRt
from_iterableR7tdifference_update(	R-RAtinclude_selftpreserve_orderingtseentunprocessedtorderedtnew_unprocessedtnew_item((RAs;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyt_walk_relationshipus(	
&


cC`s
|jd�S(NR*(RN(R-((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyt
get_ancestors�scK`s|jd|�S(NR)(RN(R-tkwargs((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pytget_descendants�scC`s+|jdkr$t|j�|_n|jS(N(R'R&RR%(R-((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyt
host_names�scC`s|jS(N(R(R-((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyR/�scC`sKt}||kr!td��n||jkrG|j�}|j�}||krtdt|j�t|j�f��n|j|�|j|�t	}|jj
|�t|jd|jg�|_|j
�|jg|jD]}|j^q�kr:|jj
|�x'|j�D]}|jd|�qWn|j�n|S(Nscan't add group to itselfsGAdding group '%s' as child to '%s' creates a recursive dependency loop.it	additions(tFalset	ExceptionR)RORRRRBRFRR7tmaxR$t_check_children_depthR*t	get_hoststpopulate_ancestorstclear_hosts_cache(R-tgrouptaddedtstart_ancestorst
new_ancestorsR>th((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pytadd_child_group�s(+


(
cC`s�|j}|j}tg�}t|j�}x�|r�|j|�|d7}|j�}tg�}x9|D]1}|j|krl||_|j|j�qlqlW||t|�kr0tdt|j���q0q0WdS(Nis5The group named '%s' has a recursive dependency loop.(	R$RR)RDR9tlenRRR(R-R$tstart_depthRIRJt
to_processR>((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyRW�s			


	cC`s_t}|j|jkr[|jj|�|jj|j�|j|�|j�t	}n|S(N(
RTRRRR%R7R'RBt	add_groupRZR(R-thostR\((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pytadd_host�s

	cC`s_t}|j|jkr[|jj|�|jj|j�|j|�|j�t}n|S(N(	RTRRRR%tremoveR'tremove_groupRZR(R-Retremoved((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pytremove_host�s

	cC`s�|dkr"|jt|��n`||jkrut|j|t�rut|t�rut|ji||6�|_n
||j|<dS(Ntansible_group_priority(tset_prioritytintR(t
isinstanceR	RR(R-tkeytvalue((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pytset_variable�s
4cC`s-d|_x|j�D]}d|_qWdS(N(R&R+RO(R-R>((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyRZ�s	cC`s(|jdkr!|j�|_n|jS(N(R+R&t
_get_hosts(R-((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyRXscC`s�g}i}x~|jdtdt�D]d}|j}xR|D]J}||kr;d||<|jdkru|jruq;n|j|�q;q;Wq%W|S(NRGRHitall(RQRR%RtimplicitR7(R-R%RItkidt	kid_hoststkk((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyRrs	

cC`s
|jj�S(N(R(R9(R-((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pytget_varsscC`s+yt|�|_Wntk
r&nXdS(N(RmR,t	TypeError(R-R,((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyRls
N(t__name__t
__module__t__doc__R&R.R0R1R3R6R2R4RTRNRORQtpropertyRRR/R`RWRfRjRqRZRXRrRxRl(((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyR#9s.						'				#		
	
	
				N((t
__future__RRRttypet
__metaclass__t	itertoolsRtansibleRRtansible.errorsRtansible.module_utils._textRRt/ansible.module_utils.common._collections_compatRR	tansible.utils.displayR
tansible.utils.varsRRRTR"R#(((s;/usr/lib/python2.7/site-packages/ansible/inventory/group.pyt<module>s	

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