403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/varnish.cpython-310.pyc
o

;jU�@srdZddlZddlZddlZe�e�ZdZdd�Z	ddd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zddd�ZdS)z�
Support for Varnish

.. versionadded:: 2014.7.0

.. note::

    These functions are designed to work with all implementations of Varnish
    from 3.x onwards
�NZvarnishcCs$tjj�d�rtjj�d�rtSdS)z6
    Only load the module if varnish is installed
    �varnishd�
varnishadm)Fz^The varnish execution module failed to load: either varnishd or varnishadm is not in the path.)�salt�utils�path�which�__virtualname__�r	r	�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/varnish.py�__virtual__srr	cKsFd|g}|�dd�|D��t�dd�|��td|fddi|��S)	a
    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
    rcSsg|]}|dur|�qS�Nr	)�.0�paramr	r	r
�
<listcomp>3sz#_run_varnishadm.<locals>.<listcomp>z
Executing: %s� zcmd.run_all�python_shellF)�extend�log�debug�join�__salt__)�cmd�params�kwargsr	r	r
�_run_varnishadm$srcCs.ddg}td|dd�}t�d|��d�}|S)z~
    Return server version from varnishd -V

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.version
    rz-Vzcmd.runF)rz\(varnish-([^\)]+)\)�)r�re�search�group)r�out�retr	r	r
�version8s
r!cCstd|g�ddkS)z
    Add ban to the varnish cache

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.ban ban_expression
    �ban�retcoder)r)Zban_expressionr	r	r
r"Hs
r"cCs*td�}|dr
dS|d�d�dd�S)zx
    List varnish cache current bans

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.ban_list
    zban.listr#F�stdout�
rN)r�split)r r	r	r
�ban_listUs
r'cCstd�S)zm
    Purge the varnish cache

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.purge
    zreq.url ~ .)r"r	r	r	r
�purgefs
r(cCstd|t|�g�ddkS)z�
    Set a param in varnish cache

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.param_set param value
    z	param.setr#r)r�str)r�valuer	r	r
�	param_setss
r+cCs^td|g�}|drdSi}|d�d�D]}t�d|�}|�d�||�d�<|r,|Sq|S)	z}
    Show params of varnish cache

    CLI Example:

    .. code-block:: bash

        salt '*' varnish.param_show param
    z
param.showr#Fr$r%z^(\w+)\s+(.*)$�r)rr&rrr)rr �result�line�mr	r	r
�
param_show�s
�r0)r	r)�__doc__�loggingrZsalt.utils.pathr�	getLogger�__name__rrrrr!r"r'r(r+r0r	r	r	r
�<module>s






Youez - 2016 - github.com/yon3zu
LinuXploit