%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlmZddl	Z
eje�Z
dZd�Zdd�Zd�Zd	�Zd
�Zd�Zd�Zdd
�ZdS(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(tabsolute_importtprint_functiontunicode_literalsN(tsixuvarnishcC@s8tjjjd�r.tjjjd�r.tStdfS(u6
    Only load the module if varnish is installed
    uvarnishdu
varnishadmu^The varnish execution module failed to load: either varnishd or varnishadm is not in the path.(tsalttutilstpathtwhicht__virtualname__tFalse(((s8/usr/lib/python2.7/site-packages/salt/modules/varnish.pyt__virtual__s*cK@shd|g}|jg|D]}|dk	r|^q�tjddj|��td|dt|�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 ucmd.run_alltpython_shellN(textendtNonetlogtdebugtjoint__salt__R	(tcmdtparamstkwargstparam((s8/usr/lib/python2.7/site-packages/salt/modules/varnish.pyt_run_varnishadm%s,cC@sAddg}td|dt�}tjd|�jd�}|S(u~
    Return server version from varnishd -V

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.version
    uvarnishdu-Vucmd.runRu\(varnish-([^\)]+)\)i(RR	tretsearchtgroup(Rtouttret((s8/usr/lib/python2.7/site-packages/salt/modules/varnish.pytversion9s
cC@std|g�ddkS(u
    Add ban to the varnish cache

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.ban ban_expression
    ubanuretcodei(R(tban_expression((s8/usr/lib/python2.7/site-packages/salt/modules/varnish.pytbanIs
cC@s3td�}|drtS|djd�dSdS(ux
    List varnish cache current bans

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.ban_list
    uban.listuretcodeustdoutu
iN(RR	tsplit(R((s8/usr/lib/python2.7/site-packages/salt/modules/varnish.pytban_listVs

cC@s
td�S(um
    Purge the varnish cache

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.purge
    ureq.url ~ .(R(((s8/usr/lib/python2.7/site-packages/salt/modules/varnish.pytpurgegs
cC@s&td|tj|�g�ddkS(u�
    Set a param in varnish cache

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.param_set param value
    u	param.seturetcodei(RRt	text_type(Rtvalue((s8/usr/lib/python2.7/site-packages/salt/modules/varnish.pyt	param_setts
cC@s�td|g�}|dr tSi}xS|djd�D]>}tjd|�}|jd�||jd�<|r:Pq:q:W|SdS(	u}
    Show params of varnish cache

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.param_show param
    u
param.showuretcodeustdoutu
u^(\w+)\s+(.*)$iiN(RR	RRRR(RRtresulttlinetm((s8/usr/lib/python2.7/site-packages/salt/modules/varnish.pyt
param_show�s

((t__doc__t
__future__RRRtloggingRtsalt.extRtsalt.utils.pathRt	getLoggert__name__RRR
RRRR R!R$R
R((((s8/usr/lib/python2.7/site-packages/salt/modules/varnish.pyt<module>s				
		
	

Zerion Mini Shell 1.0