%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZeje	�Z
d�Zd�Zd�Z
d�Zd�Zd	�Zddddddd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�ZdS(u.
The check Thorium state is used to create gateways to commands, the checks
make it easy to make states that watch registers for changes and then just
succeed or fail based on the state of the register, this creates the pattern
of having a command execution get gated by a check state via a requisite.
i(tabsolute_importtprint_functiontunicode_literalsNcC@sti|d6td6dd6id6}|tkrOt|d<dj|�|d<|St|d|krpt|d<n|S(uZ
    Only succeed if the value in the given register location is greater than
    the given value

    USAGE:

    .. code-block:: yaml

        foo:
          check.gt:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(tFalset__reg__tformattTrue(tnametvaluetret((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytgts



cC@sti|d6td6dd6id6}|tkrOt|d<dj|�|d<|St|d|krpt|d<n|S(ud
    Only succeed if the value in the given register location is greater or equal
    than the given value

    USAGE:

    .. code-block:: yaml

        foo:
          check.gte:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytgte2s



cC@sti|d6td6dd6id6}|tkrOt|d<dj|�|d<|St|d|krpt|d<n|S(uW
    Only succeed if the value in the given register location is less than
    the given value

    USAGE:

    .. code-block:: yaml

        foo:
          check.lt:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytltSs



cC@sti|d6td6dd6id6}|tkrOt|d<dj|�|d<|St|d|krpt|d<n|S(ua
    Only succeed if the value in the given register location is less than
    or equal the given value

    USAGE:

    .. code-block:: yaml

        foo:
          check.lte:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytltets



cC@sti|d6td6dd6id6}|tkrOt|d<dj|�|d<|St|d|krpt|d<n|S(uV
    Only succeed if the value in the given register location is equal to
    the given value

    USAGE:

    .. code-block:: yaml

        foo:
          check.eq:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pyteq�s



cC@sti|d6td6dd6id6}|tkrOt|d<dj|�|d<|St|d|krpt|d<n|S(uZ
    Only succeed if the value in the given register location is not equal to
    the given value

    USAGE:

    .. code-block:: yaml

        foo:
          check.ne:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytne�s



c
C@s�i|d6td6dd6id6}|tkrOt|d<dj|�|d<|Sy@|ps|ps|ps|ps|ps|}	|	rmt|dj|�}
tjd||
�t|d<|r�|dc|
|kM<n|r�|dc|
|kM<n|r
|dc|
|kM<n|r,|dc|
|kM<n|rK|dc|
|kM<n|r�|dc|
|kM<q�n!|t|dkr�t|d<nWntk
r�nX|S(	u[
    Only succeed if the value in the given register location contains
    the given value

    USAGE:

    .. code-block:: yaml

        foo:
          check.contains:
            - value: itni

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruvalu%s appears %s times(RRRtcounttlogtdebugRt	TypeError(RRtcount_ltt	count_ltetcount_eqt	count_gtetcount_gttcount_neR	t
count_comparetoccurrences((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytcontains�s@




cC@s`i|d6id6dd6td6}x7tD]/}tjjj|d|�r)t|d<q)q)W|S(uP
    Chekcs for a specific event match and returns result True if the match
    happens

    USAGE:

    .. code-block:: yaml

        salt/foo/*/bar:
          check.event

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: salt/foo/*/bar
    unameuchangesuucommenturesultutag(Rt
__events__tsalttutilststringutilst
expr_matchR(RR	tevent((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pyR"s


cC@szi|d6td6dd6id6}|tkrOt|d<dj|�|d<|Stt|d�|krvt|d<n|S(u\
    Only succeed if length of the given register location is greater than
    the given value.

    USAGE:

    .. code-block:: yaml

        foo:
          check.len_gt:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRtlenR(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytlen_gt4s



cC@szi|d6td6dd6id6}|tkrOt|d<dj|�|d<|Stt|d�|krvt|d<n|S(ui
    Only succeed if the length of the given register location is greater or equal
    than the given value

    USAGE:

    .. code-block:: yaml

        foo:
          check.len_gte:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR#R(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytlen_gteUs



cC@szi|d6td6dd6id6}|tkrOt|d<dj|�|d<|Stt|d�|krvt|d<n|S(u]
    Only succeed if the length of the given register location is less than
    the given value.

    USAGE:

    .. code-block:: yaml

        foo:
          check.len_lt:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR#R(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytlen_ltvs



cC@szi|d6td6dd6id6}|tkrOt|d<dj|�|d<|Stt|d�|krvt|d<n|S(uf
    Only succeed if the length of the given register location is less than
    or equal the given value

    USAGE:

    .. code-block:: yaml

        foo:
          check.len_lte:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR#R(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytlen_lte�s



cC@sti|d6td6dd6id6}|tkrOt|d<dj|�|d<|St|d|krpt|d<n|S(u\
    Only succeed if the length of the given register location is equal to
    the given value.

    USAGE:

    .. code-block:: yaml

        foo:
          check.len_eq:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytlen_eq�s



cC@szi|d6td6dd6id6}|tkrOt|d<dj|�|d<|Stt|d�|krvt|d<n|S(u`
    Only succeed if the length of the given register location is not equal to
    the given value.

    USAGE:

    .. code-block:: yaml

        foo:
          check.len_ne:
            - value: 42

        run_remote_ex:
          local.cmd:
            - tgt: '*'
            - func: test.ping
            - require:
              - check: foo
    unameuresultuucommentuchangesuValue {0} not in registeruval(RRRR#R(RRR	((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pytlen_ne�s



(t__doc__t
__future__RRRtloggingtsalt.utils.stringutilsRt	getLoggert__file__RR
RRR
RRtNoneRR"R$R%R&R'R(R)(((s6/usr/lib/python2.7/site-packages/salt/thorium/check.pyt<module>s.	!	!	!	!	!	#7		!	!	!	!	!

Zerion Mini Shell 1.0