%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/self/root/lib/python2.7/site-packages/salt/modules/ |
| Current File : //proc/thread-self/root/proc/self/root/lib/python2.7/site-packages/salt/modules/varnish.pyo |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l m Z d d l Z
e j e � Z
d Z d � Z d d � Z d � Z d � Z d
� Z d � Z d � Z d d
� Z d S( u�
Support for Varnish
.. versionadded:: 2014.7.0
.. note::
These functions are designed to work with all implementations of Varnish
from 3.x onwards
i ( t absolute_importt print_functiont unicode_literalsN( t sixu varnishc C@ s8 t j j j d � r. t j j j d � r. t St d f S( u6
Only load the module if varnish is installed
u varnishdu
varnishadmu^ The varnish execution module failed to load: either varnishd or varnishadm is not in the path.( t saltt utilst patht whicht __virtualname__t False( ( ( s8 /usr/lib/python2.7/site-packages/salt/modules/varnish.pyt __virtual__ s *c K@ sh d | g } | j g | D] } | d k r | ^ q � t j d d j | � � t d | d t | �S( u
Execute varnishadm command
return the output of the command
cmd
The command to run in varnishadm
params
Any additional args to add to the command line
kwargs
Additional options to pass to the salt cmd.run_all function
u
varnishadmu
Executing: %su u cmd.run_allt python_shellN( t extendt Nonet logt debugt joint __salt__R ( t cmdt paramst kwargst param( ( s8 /usr/lib/python2.7/site-packages/salt/modules/varnish.pyt _run_varnishadm% s ,c C@ sA d d g } t d | d t �} t j d | � j d � } | S( u~
Return server version from varnishd -V
CLI Example:
.. code-block:: bash
salt '*' varnish.version
u varnishdu -Vu cmd.runR u \(varnish-([^\)]+)\)i ( R R t ret searcht group( R t outt ret( ( s8 /usr/lib/python2.7/site-packages/salt/modules/varnish.pyt version9 s
c C@ s t d | g � d d k S( u
Add ban to the varnish cache
CLI Example:
.. code-block:: bash
salt '*' varnish.ban ban_expression
u banu retcodei ( R ( t ban_expression( ( s8 /usr/lib/python2.7/site-packages/salt/modules/varnish.pyt banI s
c C@ s3 t d � } | d r t S| d j d � d Sd S( ux
List varnish cache current bans
CLI Example:
.. code-block:: bash
salt '*' varnish.ban_list
u ban.listu retcodeu stdoutu
i N( R R t split( R ( ( s8 /usr/lib/python2.7/site-packages/salt/modules/varnish.pyt ban_listV s
c C@ s
t d � S( um
Purge the varnish cache
CLI Example:
.. code-block:: bash
salt '*' varnish.purge
u req.url ~ .( R ( ( ( s8 /usr/lib/python2.7/site-packages/salt/modules/varnish.pyt purgeg s
c C@ s&