%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/utils/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/utils/minions.pyc

�
���^c@@s�dZddlmZmZddlZddlZddlZddlZddlZ	ddl
Z	ddlZ	ddlZ	ddl
Z	ddlZ	ddlZ	ddlmZddlmZmZddlZ	ddlZ	ddlmZddlmZeZyddlZeZWne k
r-nXej!e"�Z#ej$d�Z%d	�Z&d
�Z'd�Z(e)ed�Z*d
e+fd��YZ,de)d�Z-dS(ua
This module contains routines used to verify the matcher against the minions
expected to return
i(tabsolute_importtunicode_literalsN(tDEFAULT_TARGET_DELIM(tCommandExecutionErrortSaltCacheError(tsix(t	ipaddressum(?x)
        (
            (?P<engine>G|P|I|J|L|N|S|E|R)  # Possible target engines
            (?P<delimiter>(?<=G|P|I|J).)?  # Optional delimiter for specific engines
        @)?                                # Engine+delimiter are separated by a '@'
                                           # character and are optional for the target
        (?P<pattern>.+)$c
C@s6t|�}|}t|�|t|�kr2tjd�}dddddddd	g}g|D]'}d
|ks�|j|�rb|^qbs2g|D]7}|g|D]}||kr�|^q�kr�|^q�r�ddj|�}	tjd
|||	�n)ddj|�}	tjd|||	�|	gSndS(Nu^[A-Z]@u(u[u{u\u?u}u]u)u*uE@u,uXNodegroup '%s' (%s) detected as an expression. Assuming compound matching syntax of '%s'uL@u\Nodegroup '%s' (%s) detected as list of nodenames. Assuming compound matching syntax of '%s'(tsettretcompiletmatchtjointlogtdebug(
t	nodegrouptwordstoperst	opers_settrett
group_type_retregex_charstxtytjoined((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_nodegroup_regex2s 4D
cC@sStj|�}|sCtjd|�idd6dd6|d6}n|j�}|S(ubParse `target_expressing` splitting it into `engine`, `delimiter`,
     `pattern` - returns a dictuUnable to parse target "%s"uengineu	delimiterupatternN(t
TARGET_REXR
RtwarningtNonet	groupdict(ttarget_expressionR
R((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytparse_targetQs
cC@s�d}d}|jdt�r�tjj|�}|dkr�xb|jd�D]3}|jdj|�d�}|dkrLqLqLqLWn|jdj|�d�}|dk	r�|jdd�}|jdd�}q�n|r�|nd||fS(u�
    Get the grains/pillar for a specific minion.  If minion is None, it
    will return the grains/pillar for the first minion it finds.

    Return value is a tuple of the minion ID, grains, and pillar
    uminion_data_cacheuminionsuminions/{0}udataugrainsupillarN(	RtgettFalsetsalttcachetfactorytlisttfetchtformat(tminiontoptstgrainstpillarR"tid_tdata((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytget_minion_databs
c
C@sNt}|dkrt�}n ||kr>tjd|�dS||kr^tjd|�dS||}t|tj�r�|j�}n5t|t	t
f�r�|}ntjd||�dS|j|�g}ddddd	g}x�|D]�}	t|	tj�stj|	�}	n|	|kr3|j
|	�q�t|	�d
kr�|	jd�r�t}|jt|	d|d
|dt��q�|j
|	�q�W|r�|jdd�|j
d	�n|j|�tjd||�|s�|r|st|||�}
|
r|
Sn|S|}t|||�}
|
r2|
Stjd||�|SdS(u#
    Recursively expand ``nodegroup`` from ``nodegroups``; ignore nodegroups in ``skip``

    If a top-level (non-recursive) call finds no nodegroups, return the original
    nodegroup definition (for backwards compatibility). Keep track of recursive
    calls via `first_call` argument
    u9Failed nodegroup expansion: illegal nested nodegroup "%s"uu2Failed nodegroup expansion: unknown nodegroup "%s"u7Nodegroup '%s' (%s) is neither a string, list nor tupleuanduorunotu(u)iuN@itskipt
first_calliunodegroup_comp(%s) => %suFNo nested nodegroups detected. Using original nodegroup definition: %sN(R RRRterrort
isinstanceRtstring_typestsplitR$ttupletaddt	text_typetappendtlent
startswithtTruetextendtnodegroup_comptinserttremoveR
R(Rt
nodegroupsR.R/texpanded_nodegrouptnglookupRRRtwordR((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyR<zs`
		


!)

t	CkMinionscB@seZdZd�Zd�Zd�Zed�Zd�Zd�Z	eed�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zed�Zd!ed!d!d�Zd!d�Zdeed�Zd!d!d�Zd�Zd!dd�Zdd!ed�Zdd!ed!d!d�Zd�Zd!d!d�Z d�Z!d�Z"d�Z#d!d!d�Z$d!d!d �Z%RS("uA
    Used to check what minions should respond from a target

    Note: This is a best-effort set of the minions that would match a target.
    Depending on master configuration (grains caching, etc.) and topology (syndics)
    the list may be a subset-- but we err on the side of too-many minions in this
    class.
    cC@sg||_tjj|�|_tjj|�|_|jjdd�dkrZd|_n	d|_dS(Nu	transportuzeromqutcpuminionsuaccepted(uzeromqutcp(	R(R!tpayloadtSerialtserialR"R#Rtacc(tselfR(((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt__init__�s	cC@s#|jt||jd�t|�S(u?
        Return minions found by looking at nodegroups
        u
nodegroups(t_check_compound_minionsR<R(R(RHtexprtgreedy((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_nodegroup_minions�scC@s$itj|j�|�d6gd6S(u?
        Return the minions found by looking via globs
        uminionsumissing(tfnmatchtfiltert_pki_minions(RHRKRL((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_glob_minions�scC@s�t|tj�r=g|jd�D]}|r"|^q"}n|j�}ig|D]}||krS|^qSd6|r~gn"g|D]}||kr�|^q�d6S(u@
        Return the minions found by looking via a list
        u,uminionsumissing(R1RR2R3RP(RHRKRLtignore_missingtmtminionsR((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_list_minions�s
+)cC@sItj|�}ig|j�D]}|j|�r|^qd6gd6S(uM
        Return the minions found by looking via regular expressions
        uminionsumissing(RR	RPR
(RHRKRLtregRS((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_pcre_minions�s2cC@s�g}tjj|jd|jd�}ytjtjj|��Wntk
rXnXy5|jdr�tjj|�r�t	j
d�tjr�t
jjj|��}|jj|�SWdQXq�t
jjj|dd��}|jj|�SWdQXn�x�t
jjjtjtjj|jd|j���D]T}|jd�r1tjjtjj|jd|j|��r1|j|�q1q1W|SWn$tk
r�}t	jd	|�|SXdS(
ub
        Retreive complete minion list from PKI dir.
        Respects cache if configured
        upki_diru
.key_cacheu	key_cacheuReturning cached minion listNtmodeurbu.u;Encountered OSError while evaluating minions in PKI dir: %s(tostpathRR(RGtmakedirstdirnametOSErrortexistsRR
RtPY2R!tutilstfilestfopenRFtloadR,tsorted_ignorecasetlistdirR9tisfileR7R0(RHRTtpki_cache_fntfn_texc((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyRP�s."

	>>c@s�jjdt�}�fd�}|r�g}	x�tjjjtjtj	j
�jd�j���D]T}
|
jd�rhtj	j
tj	j
�jd�j|
��rh|	j|
�qhqhWn$|r�|�}	nigd6gd6S|r�|r�|�}n|	}|si|	d6gd6St|	�}	x�|D]�}|rN||	krNq0n�jjdj|�d�}
|
dkr�|s0|	j|�q0q0n|
j|�}tjjj||d	|d
|d|�s0|	j|�q0q0Wt|	�}	ni|	d6gd6S(
u
        Helper function to search for minions in master caches If 'greedy',
        then return accepted minions matched by the condition or those absent
        from the cache.  If not 'greedy' return the only minions have cache
        data and matched by the condition.
        uminion_data_cachec@s�jjd�S(Numinions(R"R$((RH(s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytlist_cached_minions$supki_diru.uminionsumissinguminions/{0}udatat	delimitertregex_matchtexact_matchN(R(RR R!R`R,RdRYReRZRRGR9RfR7RR"R%R&RR>t
subdict_matchR$(RHRKRkRLtsearch_typeRlRmt
cache_enabledRjRTRhtcminionsR+tmdatatsearch_results((RHs6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_cache_minionssJ
>>


	
cC@s|j|||d�S(u@
        Return the minions found by looking via grains
        ugrains(Rt(RHRKRkRL((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_grain_minionsNscC@s|j|||ddt�S(uJ
        Return the minions found by looking via grains with PCRE
        ugrainsRl(RtR:(RHRKRkRL((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_grain_pcre_minionsTs
	cC@s|j|||d�S(u@
        Return the minions found by looking via pillar
        upillar(Rt(RHRKRkRL((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_pillar_minions^scC@s|j|||ddt�S(uJ
        Return the minions found by looking via pillar with PCRE
        upillarRl(RtR:(RHRKRkRL((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_pillar_pcre_minionsds
	cC@s|j|||ddt�S(u@
        Return the minions found by looking via pillar
        upillarRm(RtR:(RHRKRkRL((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_pillar_exact_minionsns
	cC@sE|jjdt�}|r*|j�}n-|rE|jjd�}nigd6gd6S|r-|rx|jjd�}n|}|d	kr�i|d6gd6S|}ytj|�}WnWt	k
rytj
|�}Wqt	k
r
tjd|�igd6gd6SXnXdj
|j�}t|�}x�|D]�}|jjdj
|�d�}	|	d	kr�|s4|j|�q4q4n|	jd�}
|
d	ks�||
kr�t}nSt|tjtjf�r�tj|�|
|k}ntjjj||
|�}|r4||kr4|j|�q4q4Wnit|�d6gd6S(
u@
        Return the minions found by looking via ipcidr
        uminion_data_cacheuminionsumissinguInvalid IP/CIDR target: %suipv{0}uminions/{0}udataugrainsN(R(RR RPR"R$RRt
ip_addresst	Exceptiont
ip_networkRR0R&tversionRR%R>R1tIPv4AddresstIPv6AddressRR6R!R`tnetworkt	in_subnet(RHRKRLRpRTRqttgttprotoR+RrR)R
((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_ipcidr_minionsxsT






	cC@s�tstd��nt|d�sCtjj|jd�|_ny|jj|�SWn"tjj	k
r{}t
jd|�|jjdt
�}|rBg}x�tjjjtjtjj|jd|j���D]T}|jd�r�tjjtjj|jd|j|��r�|j|�q�q�Wi|d6gd	6S|rfi|jjd�d6gd	6Sigd6gd	6SnXd
S(uJ
        Return the minions found by looking via range expression
        uYRange matcher unavailable (unable to import seco.range, module most likely not installed)u_rangeurange_serveru%Range exception in compound match: %suminion_data_cacheupki_diru.uminionsumissingN(t	HAS_RANGERthasattrtsecotrangetRangeR(t_rangetexpandtRangeExceptionRR0RR R!R`R,RdRYReRZRRGR9RfR7R"R$(RHRKRLRiRptmlistRh((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt_check_range_minions�s.
>>

cC@s|j|||dt�S(up
        Return the minions found by looking via compound matcher

        Disable pillar glob matching
        tpillar_exact(RJR:(RHRKRkRL((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt$_check_compound_pillar_exact_minions�s	c	C@s�t|tj�rHt|ttf�rHtjd�igd6gd6St|j��}tj	d|�|j
jdi�}|j
jdt�rsi	|j
d6|jd6|jd	6|jd
6|jd6d&d6|jd
6|jd6|jd6}|r|j|d	<|j|d
<ng}g}	dddddg}
g}t|tj�r\|j�}n|}xp|r�|jd�}
t|
�}|
|
kr�|r^|ddkr�|
d'kr�tjd|
�igd6gd6S|
dkrI|dd(kr|jd�n|jd�|jtjt|���|jd�|	jd�q�|
dkre|jd�q�|
dkr�|jd�q�|
dkr�|j|
�|	j|
�q�|
dkr9|	s�|	ddkr�tjd|�igd6gd6S|j|
�|	j�|	r[|	ddkr[|jd�|	j�q[q�tjd|�igd6gd6Sq�|
dkr�|jd�|jtjt|���|jd�|	jd�q�|
dkr�|j|
�|	j|
�q�tjd|
�igd6gd6Sqf|rp|drpd|dkrJt|d|�}|rf||}qfqfn|j|d�}|s�tjd |d|
�igd6gd6S|dg}|dd)kr�|j|d!p�d"�n|j|�d|dkr|j|o�|ddk�n||�}|jtjt|d���|j|d�|	r�|	ddkr�|jd�|	j�q�qf|j|
t�}|jtjt|d���|	rf|	ddkrf|jd�|	j�qfqfW|jg|	D]}d^q��d#j |�}tj	d$|�y(tt!|��}i|d6|d6SWqst"k
rotjd%|�igd6gd6SXnit|�d6gd6S(*uJ
        Return the minions found by looking via compound matcher
        u6Compound target that is neither string, list nor tupleuminionsumissinguminions: %su
nodegroupsuminion_data_cacheuGuPuIuJuLuNuSuEuRuanduorunotu(u)ii����u(Invalid beginning operator after "(": %su&u|u-u8Invalid compound expr (unexpected right parenthesis): %su#Unhandled oper in compound expr: %su-Expression may begin with binary operator: %suengineupatternu:Unrecognized target engine "%s" for target expression "%s"u	delimiteru:u u+Evaluating final compound matching expr: %suInvalid compound target: %sN(uanduor(u&u|u((uGuPuIuJ(#R1RR2R$R4RR0RRPR
R(RR RuRvRwRxRURR�RWt_all_minionsRyR3tpopRR7R6R<R;RQR:RtevalR{(RHRKRkRLR�RTR?treftresultst	unmatchedRtmissingRRBttarget_infot
decomposedtenginetengine_argst_resultstitem((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyRJ�s�)









	


	


	





  
 
 	
c
C@s^|dk	r%tjjjdd�n|dk	rJtjjjdd�nt�}|jjdt�rZ|j	j
d�}|dkr�|Stjjjt
|jd��}d|kr�|jd�|jttjjjdt���nd	|kr.|jd	�|jttjjjdt���n|r=|}nx|D]}y"|j	jd
j|�d�}	Wntk
r�qDnX|	dkr�qDn|	jdi�}
xS|
jd
g�D]?}||kr�|r�|j||f�n
|j|�Pq�q�WxS|
jdg�D]?}||kr|r>|j||f�n
|j|�PqqWqDWn|S(uV
        Return a set of all connected minion ids, optionally within a subset
        uSodiumunThe 'include_localhost' argument is no longer required; anyconnected localhost minion will always be included.uwThe 'show_ipv4' argument has been renamed to 'show_ip' asit now also includes IPv6 addresses for IPv6-connectedminions.uminion_data_cacheuminionsupublish_portu	127.0.0.1tinclude_loopbacku::1uminions/{0}udataugrainsuipv4uipv6N(RR!R`tversionst
warn_untilRR(RR R"R$R�tlocal_port_tcptinttdiscardtupdatetip_addrst	ip_addrs6R%R&RR5(
RHtsubsettshow_ipt	show_ipv4tinclude_localhostRTtsearchtaddrsR+RrR)tipv4tipv6((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt
connected_idsysV

	"
(
(	
"


cC@s�g}x�tjjjtjtjj|jd|j	���D]T}|j
d�r>tjjtjj|jd|j	|��r>|j|�q>q>Wi|d6gd6S(u?
        Return a list of all minions that have auth'd
        upki_diru.uminionsumissing(
R!R`R,RdRYReRZRR(RGR9RfR7(RHRKR�Rh((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyR��s
>>uglobc	C@s:y�|dkrd}nt|dj|�d�}|dkrT||||�}n|||�}t|d
<|jjdt�tkr�tdtj	�r�t
jj|j|jjd
d��}|j
||�}|r�|dj|�t|d
<q�nWn8tk
r5tjd||�igd6gd6}nX|S(u
        Check the passed regex against the available minions' public keys
        stored for authentication. This should return a set of ids which
        match the regex, this will then be used to parse the returns to
        make sure everyone has checked back in.
        uu_check_{0}_minionsugrainu
grain_pcreupillarupillar_pcreupillar_exactucompounducompound_pillar_exactussh_minionsuenable_ssh_minionsutgturosteruflatuminionsu5Failed matching available minions with %s pattern: %sumissingN(ugrainu
grain_pcreupillarupillar_pcreupillar_exactucompounducompound_pillar_exact(RtgetattrR&R R(RR:R1RR2R!trostertRosterttargetsR;R{Rt	exception(	RHRKttgt_typeRkRLt
check_funct_resR�tssh_minions((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt
check_minions�s4		
-'

c	C@s�t|j|d�jdg��}|dkrU|j||�}t|d�}nt|�}t|j|��}t|�t|�kr�|r�tS|S(u�
        Return a Bool. This function returns if the expression sent in is
        within the scope of the valid expression
        ucompounduminionsN(RR�RRtboolt
differenceR8R:(	RHtvalidRKR�RTt	expr_formt	v_minionsR�td_bool((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytvalidate_tgt�s$cC@s�g}t|tj�r$|g}nxe|D]]}y3tj||�rV|jt�n
|jt�Wq+tk
r�t	j
d|�q+Xq+W|o�t|�S(u�
        Validate a single regex to function comparison, the function argument
        can be a list of functions. It is all or nothing for a list of
        functions
        uInvalid regular expression: %s(R1RR2RR
R7R:R R{RR0tall(RHtregextfuntvalstfunc((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytmatch_check�s

cC@sQtjjjdd�|dkr;|j|||||�S|j||||�S(uT
        Read in the form and determine which auth check routine to execute
        uNeonuiThe 'any_auth' function has been deprecated. Support for this function will be removed in Salt {version}.upublish(R!R`R�R�t
auth_checkt
spec_check(RHtformt	auth_listR�targR�R�((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytany_authscC@s�|}|j�d
kr!d}n|j�dkr<d}n|j||�}	t|	d�}
|j||�}	t|	d�}t|j|
��}|r�|r�tSnt|t�s�|g}|g}nt�}
i}x|D]�}t|tj	�r'x$|D]}|j
||�rtSqWq�nt|t�rat
|�dkratjd|�q�qan|
jt|j���xc|D][}xRt|j|d��D]8}||kr�||j||�q�||||<q�Wq�Wq�Wt�}x-|
D]%}|jt|j|d���q�Wt
||�d	kr7tSyix^|D]V}g}x7t||�D]%\}}|j|j
||��q^Wt|�sAtSqAWtSWntk
r�tSXtS(Nupillarupillar_pcreupillar_exactucompounducompound_pillar_exactuminionsiuMalformed ACL: %si(upillarupillar_pcre(tlowerR�RR�R�R R1R$RR2R�R:tdictR8RtinfoR�tkeysR;t	enumerateR7tanyt	TypeError(RHR�tfunstargsR�R�tgroupstpublish_validatet
v_tgt_typeR�R�RTtmismatchtallowed_minionstauth_dictionarytauth_list_entryR�tkeyR
tallowed_minions_from_auth_listt
next_entryR'R�tnum((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytauth_check_expanded$sd)				

	
	
#

c
	C@s`|jjdt�r4|j|||||||�S|r�|}
|j�dkr[d}
n|j�dkrvd}
n|j||
�}t|d�}|j||�}t|d�}t|j|��}
|
r�tSnt	|t
�s|g}|g}nyGx@t|�D]2\}}|	r2||	kr2tSx
|D]}t	|t
j�rj|j||�r>tSq9t	|t�r9t|�dkr�q9ntt
j|��}|j|||d	|�r>||}|r�|d
nd
}t	|t�rd|krt
|�}|d
=nd
}|j|||||�r;tSq>q9q9WqWWntk
r[tSXtS(u�
        Returns a bool which defines if the requested function is authorized.
        Used to evaluate the standard structure under external master
        authentication interfaces, like eauth, peer, peer_run, etc.
        u"auth.enable_expanded_auth_matchingupillarupillar_pcreupillar_exactucompounducompound_pillar_exactuminionsiRTi����u	__kwarg__(upillarupillar_pcreN(R(RR R�R�R�RR�R�R1R$R�R:RR2R�R�R8tnexttiterkeysR�Rt_CkMinions__fun_checkR�(RHR�R�R�R�R�R�R�RTt	whitelistR�R�R�R�R�R�tindR�tfun_argst
fun_kwargs((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyR��s\			
	


cC@s�g|D]}|jd�r|^q}|r|xK|D]@}|jd�|kr5x"||D]}|j|�q[Wq5q5Wn|S(u�
        Returns a list of authorisation matchers that a user is eligible for.
        This list is a combination of the provided personal matchers plus the
        matchers of any group the user is in.
        u%(tendswithtrstripR7(RHt
auth_providertuser_groupsR�R�tgroup_namest
group_nametmatcher((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytfill_auth_list_from_groups�s(
cC@s|dkrg}n|dkr6|jjd�}nt}x�|D]�}|dkrb|rbqCn|jd�r�|jd�|kr�|j||�q�qCtjj	j
||�rCt}|j||�qCqCW|r|rd|kr|j|d�n|S(u�
        Returns a list of authorisation matchers that a user is eligible for.
        This list is a combination of the provided personal matchers plus the
        matchers of any group the user is in.
        upermissive_aclu*u%N(RR(RR R�R�R;R!R`tstringutilst
expr_matchR:(RHR�tnameR�R�t
permissivetname_matchedR
((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytfill_auth_list�s"	
cC@s|j|||d�S(u/
        Check special API permissions
        uwheel(R�(RHR�R�R�((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytwheel_checkscC@s|j|||d�S(u/
        Check special API permissions
        urunner(R�(RHR�R�R�((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytrunner_check
sc
C@s�|s
tS|dkrg|jd�}t|�dkrPiidd6dd6d6S|d	}|d
}n
|}}x`|D]X}t|tj�r�|d	dkr�|d
|ks�|d
|ks�|dj|�kr�tSq�qxt|t�rxt|�d
krqxnt	tj
|��}	|	d	dkr�|	d
|krp|j||	||jd
�|jd��rptSn|	d
|ks�|	dj|�kr�|j||	||jd
�|jd��r�tSq�q�qxqxWtS(u/
        Check special API permissions
        ucloudu.iuSaltInvocationErrorunameu2A command invocation error occurred: Check syntax.umessageuerroriiu@u@{0}suargukwarg(
R R3R8R1RR2R&R:R�R�R�R�R(
RHR�R�R�R�tcompstmod_nametfun_nameR�R�((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyR�s6




5
.%.cC@s�t|t�s|g}nx�|D]�}t|tj�rS|j||�r�tSq"t|t�r"t|�dkrzq"nttj	|��}|j||�r�|j
||||�r�tSq�q"q"WtS(un
        Check the given function name (fun) and its arguments (args) against the list of conditions.
        i(R1R$RR2R�R:R�R8R�R�t_CkMinions__args_checkR (RHR�R�R�tkwargstcondt
fname_cond((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt__fun_check7s
cC@s�t|t�s|g}nx`|D]X}t|t�s=q"n|jdg�}t}x}t|�D]o\}}|dks�t|�|kr�t}Pn|dkr�qbn|j	|t
j||��sbt}PqbqbW|s�q"n|jdi�}	xzt
j|	�D]i\}
}|dks'|
|kr1t}Pn|dkrCqn|j	|t
j||
��st}PqqW|r"tSq"WtS(u]
        valid is a dicts: {'args': [...], 'kwargs': {...}} or a list of such dicts.
        uargsukwargsN(
R1R$R�RR:R�RR8R R�RR6t	iteritems(RHR�R�R�R�t	cond_argstgoodtitcond_argtcond_kwargstktv((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt__args_checkMs>
N(&t__name__t
__module__t__doc__RIRMRQR RURWRPRtRuRvRwRxRyR�R�R�RJRR�R�RR:R�R�R�R�R�R�R�R�R�R�R�R�R�(((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyRC�sR	
		
		%3		
		
	
	:	 	�=$	q@				$uglobc
C@s�i}tjj|�}t|�}|j||�}|d}tjj|�}	x]|D]U}
|	jdj|
�d�}|dkr�qYn|j
|�}|rY|||
<qYqYW|S(u|
    Gathers the data from the specified minions' mine, pass in the target,
    function to look up and the target type
    uminionsuminions/{0}umineN(R!RDRERCR�R"R#R%R&RR(
R�R�R�R(RRFtcheckerR�RTR"R'Rrtfdata((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pytmine_getus 	

(.Rt
__future__RRRYRNRtloggingtsalt.payloadR!tsalt.rostertsalt.utils.datatsalt.utils.filestsalt.utils.networktsalt.utils.stringutilstsalt.utils.versionst
salt.defaultsRtsalt.exceptionsRRtsalt.auth.ldapt
salt.cachetsalt.extRtsalt._compatRR R�t
seco.rangeR�R:tImportErrort	getLoggerR
RR	RRRR-RR<tobjectRCR(((s6/usr/lib/python2.7/site-packages/salt/utils/minions.pyt<module>sH

				G����

Zerion Mini Shell 1.0