HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/memcached.cpython-310.pyc
o

�N�g}�@sbdZddlmZmZddlmZmZmZmZdZ	dd�Z
deeeefdd	�Zdeeefd
d�ZdS)zm
States for Management of Memcached Keys
=======================================

.. versionadded:: 2014.1.0
�)�CommandExecutionError�SaltInvocationError)�DEFAULT_HOST�DEFAULT_MIN_COMPRESS_LEN�DEFAULT_PORT�DEFAULT_TIMEZ	memcachedcCst�d�tvr	tSdS)z3
    Only load if memcache module is available
    z.status)Fz$memcached module could not be loaded)�__virtualname__�__salt__�r
r
�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/memcached.py�__virtual__srNc	
Csj|iddd�}z
td|||�}Wnty+}zt|�|d<|WYd}~Sd}~ww||kr>d|d<d	|�d
�|d<|Stdr^d|d<|durTd	|�d�|d<|Sd
|�d�|d<|Sztd||||||�|d<Wnttfy�}z
t|�|d<WYd}~|Sd}~ww|dr�d|�d�|d<|dur�||d�|d<|S||d�|d<|Sd|�d�|d<|S)a3
    Manage a memcached key.

    name
        The key to manage

    value
        The value to set for that key

    host
        The memcached server IP address

    port
        The memcached server port


    .. code-block:: yaml

        foo:
          memcached.managed:
            - value: bar
    F���name�changes�result�comment�
memcached.getrNTr�Key 'z' does not need to be updated�testz' would be addedzValue of key 'z' would be changedz
memcached.setzSuccessfully set key '�')�old�newr)z	key added�valuezFailed to set key ')r	r�str�__opts__r)	rr�host�port�timeZmin_compress_len�ret�cur�excr
r
r�managedsJ����
����r"c
Csf|iddd�}z
td|||�}Wnty+}zt|�|d<|WYd}~Sd}~ww|durG|durG||krGd|d<d	�|||�|d<|S|durYd|d<d
|�d�|d<|Stdrkd|d<d
|�d
�|d<|Sz
td||||�|d<Wnttfy�}z
t|�|d<WYd}~|Sd}~ww|dr�d|�d�|d<||d�|d<|Sd|�d�|d<|S)a�
    Ensure that a memcached key is not present.

    name
        The key

    value : None
        If specified, only ensure that the key is absent if it matches the
        specified value.

    host
        The memcached server IP address

    port
        The memcached server port


    .. code-block:: yaml

        foo:
          memcached.absent

        bar:
          memcached.absent:
            - host: 10.0.0.1
    Fr
rrrNTrz$Value of key '{}' ('{}') is not '{}'rz' does not existrz' would be deletedzmemcached.deletezSuccessfully deleted key 'r)zkey deletedrrzFailed to delete key ')r	rr�formatrr)rrrrrrr r!r
r
r�absentasH������r$)
�__doc__Zsalt.exceptionsrrZsalt.modules.memcachedrrrrrrr"r$r
r
r
r�<module>s
�E