%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/thorium/ |
| Current File : //proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/thorium/check.pyo |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z e j e � Z
d � Z d � Z d � Z
d � Z d � Z d � Z d d d d d d d
� Z d � Z d � Z d
� Z d � Z d � Z d � Z d � Z d S( 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 ( t absolute_importt print_functiont unicode_literalsNc C@ st i | d 6t d 6d d 6i d 6} | t k rO t | d <d j | � | d <| St | d | k rp t | 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
u nameu resultu u commentu changesu Value {0} not in registeru val( t Falset __reg__t formatt True( t namet valuet ret( ( s6 /usr/lib/python2.7/site-packages/salt/thorium/check.pyt gt s
c C@ st i | d 6t d 6d d 6i d 6} | t k rO t | d <d j | � | d <| St | d | k rp t | 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
u nameu resultu u commentu changesu Value {0} not in registeru val( R R R R ( R R R ( ( s6 /usr/lib/python2.7/site-packages/salt/thorium/check.pyt gte2 s
c C@ st i | d 6t d 6d d 6i d 6} | t k rO t | d <d j | � | d <| St | d | k rp t | 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
u nameu resultu u commentu changesu Value {0} not in registeru val( R R R R ( R R R ( ( s6 /usr/lib/python2.7/site-packages/salt/thorium/check.pyt ltS s
c C@ st i | d 6t d 6d d 6i d 6} | t k rO t | d <d j | � | d <| St | d | k rp t | 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
u nameu resultu u commentu changesu Value {0} not in registeru val( R R R R ( R R R ( ( s6 /usr/lib/python2.7/site-packages/salt/thorium/check.pyt ltet s
c C@ st i | d 6t d 6d d 6i d 6} | t k rO t | d <d j | � | d <| St | d | k rp t | 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
u nameu resultu u commentu changesu Value {0} not in registeru val( R R R R ( R R R ( ( s6 /usr/lib/python2.7/site-packages/salt/thorium/check.pyt eq� s
c C@ st i | d 6t d 6d d 6i d 6} | t k rO t | d <d j | � | d <| St | d | k rp t | 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
u nameu resultu u commentu changesu Value {0} not in registeru val( R R R R ( R R R ( ( s6 /usr/lib/python2.7/site-packages/salt/thorium/check.pyt ne� s
c
C@ s� i | d 6t d 6d d 6i d 6} | t k rO t | d <d j | � | d <| Sy@| ps | ps | ps | ps | ps | } | rmt | d j | � }
t j d | |
� t | d <| r� | d c |
| k M<n | r� | d c |
| k M<n | r
| d c |
| k M<n | r,| d c |
| k M<n | rK| d c |
| k M<n | r�| d c |
| k M<q�n! | t | d k r�t | d <n Wn t k
r�n X| 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
u nameu resultu u commentu changesu Value {0} not in registeru valu %s appears %s times( R R R t countt logt debugR t TypeError( R R t count_ltt count_ltet count_eqt count_gtet count_gtt count_neR t
count_comparet occurrences( ( s6 /usr/lib/python2.7/site-packages/salt/thorium/check.pyt contains� s@
c C@ s` i | d 6i d 6d d 6t d 6} x7 t D]/ } t j j j | 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
u nameu changesu u commentu resultu tag( R t
__events__t saltt utilst stringutilst
expr_matchR ( R R t event( ( s6 /usr/lib/python2.7/site-packages/salt/thorium/check.pyR"