%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/match.pyo

�
���^c@@s=dZddlmZmZmZddlZddlZddlZddlZddl	Z
ddlZ
ddlm
Z
ddlmZidd6Zeje�Zdd�Zd	�Ze
d
�Ze
d�Zd�Ze
d
�Ze
d�Zdd�Zdd�Zdd�Zdddd�Zddd�Z dS(uQ
The match module allows for match routines to be run and determine target specs
i(tabsolute_importtprint_functiontunicode_literalsN(tDEFAULT_TARGET_DELIM(tsixulistulist_cC@s�|dk	rLtjt�}t|tj�s?tj|�}n||d<nt}tjj	|�}y|d|d|�SWn!t
k
r�}tj|�t
SXdS(u"
    Return True if the minion ID matches the given compound target

    minion_id
        Specify the minion ID to match against the target expression

        .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' match.compound 'L@cheese,foo and *'
    uiducompound_match.matchtoptsN(tNonetcopyt__opts__t
isinstanceRtstring_typest	text_typetsalttloadertmatcherst	Exceptiontlogt	exceptiontFalse(ttgtt	minion_idRRtexc((s6/usr/lib/python2.7/site-packages/salt/modules/match.pytcompounds

cC@sRtjjt�}y|d|dt�SWn!tk
rM}tj|�tSXdS(u/
    Return True if the minion matches the given ipcidr target

    CLI Example:

    .. code-block:: bash

        salt '*' match.ipcidr '192.168.44.0/24'

    delimiter
    Pillar Example:

    .. code-block:: yaml

       '172.16.0.0/12':
         - match: ipcidr
         - nodeclass: internal

    uipcidr_match.matchRN(RR
RRRRRR(RRR((s6/usr/lib/python2.7/site-packages/salt/modules/match.pytipcidr8s
cC@sXtjjt�}y|d|d|dt�SWn!tk
rS}tj|�tSXdS(ur
    Return True if the minion matches the given pillar_pcre target. The
    ``delimiter`` argument can be used to specify a different delimiter.

    CLI Example:

    .. code-block:: bash

        salt '*' match.pillar_pcre 'cheese:(swiss|american)'
        salt '*' match.pillar_pcre 'clone_url|https://github\.com/.*\.git' delimiter='|'

    delimiter
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: 2014.7.0

    delim
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: 0.16.4
        .. deprecated:: 2015.8.0
    upillar_pcre_match.matcht	delimiterRN(RR
RRRRRR(RRRR((s6/usr/lib/python2.7/site-packages/salt/modules/match.pytpillar_pcreTs
cC@sXtjjt�}y|d|d|dt�SWn!tk
rS}tj|�tSXdS(u`
    Return True if the minion matches the given pillar target. The
    ``delimiter`` argument can be used to specify a different delimiter.

    CLI Example:

    .. code-block:: bash

        salt '*' match.pillar 'cheese:foo'
        salt '*' match.pillar 'clone_url|https://github.com/saltstack/salt.git' delimiter='|'

    delimiter
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: 2014.7.0

    delim
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: 0.16.4
        .. deprecated:: 2015.8.0
    upillar_match.matchRRN(RR
RRRRRR(RRRR((s6/usr/lib/python2.7/site-packages/salt/modules/match.pytpillarss
cC@sRtjjt�}y|d|dt�SWn!tk
rM}tj|�tSXdS(u�
    Return True if the minion matches the given data target

    CLI Example:

    .. code-block:: bash

        salt '*' match.data 'spam:eggs'
    udata_match.matchRN(RR
RRRRRR(RRR((s6/usr/lib/python2.7/site-packages/salt/modules/match.pytdata�s

cC@sXtjjt�}y|d|d|dt�SWn!tk
rS}tj|�tSXdS(uH
    Return True if the minion matches the given grain_pcre target. The
    ``delimiter`` argument can be used to specify a different delimiter.

    CLI Example:

    .. code-block:: bash

        salt '*' match.grain_pcre 'os:Fedo.*'
        salt '*' match.grain_pcre 'ipv6|2001:.*' delimiter='|'

    delimiter
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: 2014.7.0

    delim
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: 0.16.4
        .. deprecated:: 2015.8.0
    ugrain_pcre_match.matchRRN(RR
RRRRRR(RRRR((s6/usr/lib/python2.7/site-packages/salt/modules/match.pyt
grain_pcre�s
cC@sXtjjt�}y|d|d|dt�SWn!tk
rS}tj|�tSXdS(uH
    Return True if the minion matches the given grain target. The ``delimiter``
    argument can be used to specify a different delimiter.

    CLI Example:

    .. code-block:: bash

        salt '*' match.grain 'os:Ubuntu'
        salt '*' match.grain 'ipv6|2001:db8::ff00:42:8329' delimiter='|'

    delimiter
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: 2014.7.0

    delim
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: 0.16.4
        .. deprecated:: 2015.8.0
    ugrain_match.matchRRN(RR
RRRRRR(RRRR((s6/usr/lib/python2.7/site-packages/salt/modules/match.pytgrain�s
cC@s�|dk	rLtjt�}t|tj�s?tj|�}n||d<nt}tjj	|�}y|d|dt�SWn!t
k
r�}tj|�t
SXdS(u
    Return True if the minion ID matches the given list target

    minion_id
        Specify the minion ID to match against the target expression

        .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' match.list 'server1,server2'
    uidulist_match.matchRN(RRRR	RR
RRR
RRRRR(RRRRR((s6/usr/lib/python2.7/site-packages/salt/modules/match.pytlist_�s

cC@s�|dk	rLtjt�}t|tj�s?tj|�}n||d<nt}tjj	|�}y|d|dt�SWn!t
k
r�}tj|�t
SXdS(u

    Return True if the minion ID matches the given pcre target

    minion_id
        Specify the minion ID to match against the target expression

        .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' match.pcre '.*'
    uidupcre_match.matchRN(RRRR	RR
RRR
RRRRR(RRRRR((s6/usr/lib/python2.7/site-packages/salt/modules/match.pytpcres

cC@s�|dk	rLtjt�}t|tj�s?tj|�}n||d<nt}tjj	|�}y|d|dt�SWn!t
k
r�}tj|�t
SXdS(u	
    Return True if the minion ID matches the given glob target

    minion_id
        Specify the minion ID to match against the target expression

        .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' match.glob '*'
    uiduglob_match.matchRN(RRRR	RR
RRR
RRRRR(RRRRR((s6/usr/lib/python2.7/site-packages/salt/modules/match.pytglobs

ucompoundudefaultcC@syttjtjtdtj��}xA|D]9}|rD||fn|f}|||�r,||Sq,W|j|d�S(u<
    Return the first match in a dictionary of target patterns

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' match.filter_by '{foo*: Foo!, bar*: Bar!}' minion_id=bar03

    Pillar Example:

    .. code-block:: jinja

        # Filter the data for the current minion into a variable:
        {% set roles = salt['match.filter_by']({
            'web*': ['app', 'caching'],
            'db*': ['db'],
        }, default='web*') %}

        # Make the filtered data available to Pillar:
        roles: {{ roles | yaml() }}
    t	predicateN(	tdicttinspectt
getmemberstsystmodulest__name__t
isfunctiontgetR(tlookupttgt_typeRtdefaultt
expr_funcstkeytparams((s6/usr/lib/python2.7/site-packages/salt/modules/match.pyt	filter_by=s
c	C@s�ttjtjtdtj��}g}xf|j�D]X\}}xI|D]A}|rc||fn|f}|||�rK|j|�qKqKWq8W|p�dS(u
    Search a dictionary of target strings for matching targets

    This is the inverse of :py:func:`match.filter_by
    <salt.modules.match.filter_by>` and allows matching values instead of
    matching keys. A minion can be matched by multiple entries.

    .. versionadded:: 2017.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' match.search_by '{web: [node1, node2], db: [node2, node]}'

    Pillar Example:

    .. code-block:: jinja

        {% set roles = salt.match.search_by({
            'web': ['G@os_family:Debian not nodeX'],
            'db': ['L@node2,node3 and G@datacenter:west'],
            'caching': ['node3', 'node4'],
        }) %}

        # Make the filtered data available to Pillar:
        roles: {{ roles | yaml() }}
    R!N(
R"R#R$R%R&R'R(titemstappendR(	R*R+RR-tmatchesR.ttarget_listttargetR/((s6/usr/lib/python2.7/site-packages/salt/modules/match.pyt	search_byds
(!t__doc__t
__future__RRRR#tloggingR%Rtsalt.minionRtsalt.loadert
salt.defaultsRtsalt.extRt__func_alias__t	getLoggerR'RRRRRRRRRRRR R0R6(((s6/usr/lib/python2.7/site-packages/salt/modules/match.pyt<module>s4
		 $

Zerion Mini Shell 1.0