Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/module_utils/facts/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyo

�
�Udac@`s+ddlmZmZmZeZddlmZddlZddl	m
Z
defd��YZde
fd��YZd	efd
��YZddd��YZdddddd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zddddddd�ZdS(i(tabsolute_importtdivisiontprint_function(tdefaultdictN(ttimeouttCycleFoundInFactDepscB`seZdZRS(s Indicates there is a cycle in fact collector deps

    If collector-B requires collector-A, and collector-A requires
    collector-B, that is a cycle. In that case, there is no ordering
    that will satisfy B before A and A and before B. That will cause this
    error to be raised.
    (t__name__t
__module__t__doc__(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyR'stUnresolvedFactDepcB`seZRS((RR(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyR	2stCollectorNotFoundErrorcB`seZRS((RR(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyR
6stBaseFactCollectorcB`steZe�ZdZdZe�Zddd�Ze	d��Z
d�Zd�Zddd�Z
ddd�ZRS(tGenericcC`sD|p	g|_||_t|jg�|_|jj|j�dS(szBase class for things that collect facts.

        'collectors' is an optional list of other FactCollectors for composing.N(t
collectorst	namespacetsettnametfact_idstupdatet	_fact_ids(tselfR
R((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyt__init__As	cC`s#|jdd�|jkr|SdS(Ntsystem(tgettNonet	_platform(tclst
platform_info((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pytplatform_matchNscC`s|jr|jj|�S|S(N(Rt	transform(Rtkey_name((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyt_transform_nameTs	cC`sCx<t|j��D](}|j|�}|j|�||<qW|S(sKupdate a dicts keys to use new names as transformed by self._transform_name(tlisttkeysRtpop(Rt	fact_dicttold_keytnew_key((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyt_transform_dict_keysYscC`s7|jd|d|�}|jr3|j|�}n|S(Ntmoduletcollected_facts(tcollectRR&(RR'R(t
facts_dict((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pytcollect_with_namespacecs	cC`s
i}|S(sBdo the fact collection

        'collected_facts' is a object (a dict, likely) that holds all previously
          facts. This is intended to be used if a FactCollector needs to reference
          another fact (for ex, the system arch) and should not be modified (usually).

          Returns a dict of facts.

          ((RR'R(R*((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyR)js
N(RRRRRRRtrequired_factsRtclassmethodRRR&R+R)(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyR:s		
		
cC`s�|pdg}|pt�}|p*t�}|p<tt�}t�}t�}dg}|j|�t�}x<|D]4}	|	}
|
dkr�|j|�qwn|
dkr�|j|�qwn|
jd�r%|	d}	|	dkr�|j|�qwn|	dkr|j||�qwnt}nt}|r]|j|j|	t���|j	|	�qw|
|kr�t
d|	djt|��f��n|j	|	�|j	|	�qwW|s�|j|�n|j
||�|S(sEreturn a set of FactCollector names based on gather_subset spec.

    gather_subset is a spec describing which facts to gather.
    valid_subsets is a frozenset of potential matches for gather_subset ('all', 'network') etc
    minimal_gather_subsets is a frozenset of matches to always use, even for gather_subset='!all'
    talltmint!isHBad subset '%s' given to Ansible. gather_subset options allowed: all, %ss, (t	frozensetRRtextendRt
startswithtTruetFalseRtaddt	TypeErrortjointsortedtdifference_update(t
valid_subsetstminimal_gather_subsett
gather_subsettaliases_mapRtadditional_subsetstexclude_subsetstgather_subset_with_mintexplicitly_addedtsubsett	subset_idtexclude((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pytget_collector_namesxsN
			
	




	"
cC`s�t�}t�}xu|D]m}d}x^|D]V}|j|�}|sMq,n|j}||kr,|j|�|j|j�q,q,WqW|S(N(RRRRR6(tall_collector_classestcompat_platformstfound_collectorstfound_collectors_namestcompat_platformRtall_collector_classtprimary_name((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pytfind_collectors_for_platform�s		

	
cC`s�tt�}tt�}x^|D]V}|j}||j|�x3|jD](}||j|�||j|�qIWqW||fS(N(RR RRtappendRR6(tcollectors_for_platformtfact_id_to_collector_mapR>tcollector_classRMtfact_id((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pytbuild_fact_id_to_collector_map�s
	cC`spt�}g}xZ|D]R}|j|g�}x7|D]/}||kr5|j|�|j|�q5q5WqW|S(N(RRROR6(tcollector_namestall_fact_subsetstseen_collector_classestselected_collector_classestcollector_nametcollector_classesRR((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pytselect_collector_classes�s	


cC`s`t�}y||}Wn!tk
r:td|��nXx|D]}|j|j�qBW|S(NsFact collector "%s" not found(RtKeyErrorR
RR,(RYRVR,RZRR((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyt_get_requires_by_collector_name�s	

cC`sZt�}xJ|D]B}t||�}x*|D]"}||kr,|j|�q,q,WqW|S(s�Find any collector names that have unresolved requires

    Returns a list of collector names that correspond to collector
    classes whose .requires_facts() are not in collector_names.
    (RR]R6(RURVt
unresolvedRYR,t
required_fact((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pytfind_unresolved_requires
s	

cC`sot�}g}x7|D]/}||kr8|j|�q|j|�qW|rktddj|���n|S(Nsunresolved fact dep %st,(RR6ROR	R8(tunresolved_requiresRVt	new_namestfailedR^((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pytresolve_requiress	
cC`sjtt�}xW|D]O}t�}x3||D]'}x|jD]}|j|�q=Wq-W|||<qW|S(N(RRR,R6(RURVtdep_mapRYtcollector_depst	collectortdep((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pytbuild_dep_data)s
	cC`s�g}|j�}x�|r�t}xat|j��D]M\}}x>|D]}||krGPqGqGWt}||=|j||f�q4W|std|��qqW|S(Ns?Unable to tsort deps, there was a cycle in the graph. sorted=%s(tcopyR5R titemsR4ROR(Rftsorted_listtunsorted_maptacyclictnodetedgestedge((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyttsort4s	
cC`sg|j�}|j�}xHtrbt||�}|t�krCPnt||�}|j|�qW|S(N(RkR4R`RReR(RURVR^t	solutionsRc((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyt_solve_depsJs	cC`s.|p	g}|pt�}|p1itj�d6}|p@tj}|t_|pXt�}tt�}|idd6g}t||�}t	|�\}	}t|	j
��}
td|
d|d|d|d|�}t||	�}t
||	�}
t|
�}g|D]}|d^q}t||	�}|S(	s6return a list of collector classes that match the argsRRR;R<R=R>Ri(R1tplatformRRtDEFAULT_GATHER_TIMEOUTtGATHER_TIMEOUTRRRNRTR!RFRuRjRsR[(RGR;R<R=tgather_timeoutRR>RHRPRVtall_valid_subsetsRUtcomplete_collector_namesRftordered_depstxtordered_collector_namesRX((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyt$collector_classes_from_gather_subsetYs.
			((t
__future__RRRttypet
__metaclass__tcollectionsRRvtansible.module_utils.factsRt	ExceptionRt
ValueErrorR	R\R
RRRFRNRTR[R]R`ReRjRsRuR(((sH/usr/lib/python2.7/site-packages/ansible/module_utils/facts/collector.pyt<module>s8>K									

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