%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/redismod.pyo

�
���^c@@sndZddlmZmZmZddlZdZd�Zddd�Z	dd�Z
dddd�ZdS(	u|
Management of Redis server
==========================

.. versionadded:: 2014.7.0

:depends:   - redis Python module
:configuration: See :py:mod:`salt.modules.redis` for setup instructions.

.. code-block:: yaml

    key_in_redis:
      redis.string:
        - value: string data

The redis server information specified in the minion config file can be
overridden in states using the following arguments: ``host``, ``post``, ``db``,
``password``.

.. code-block:: yaml

    key_in_redis:
      redis.string:
        - value: string data
        - host: localhost
        - port: 6379
        - db: 0
        - password: somuchkittycat
i(tabsolute_importtunicode_literalstprint_functionNurediscC@sdtkrtStS(u6
    Only load if the redis module is in __salt__
    u
redis.set_key(t__salt__t__virtualname__tFalse(((s8/usr/lib/python2.7/site-packages/salt/states/redismod.pyt__virtual__%scK@s�i|d6id6td6dd6}td||�}||krptd|||�d|d|<d	|d<n|r�td
|||�dj|�|dd<n4|r�td
|||�dj|�|dd<n|S(u)
    Ensure that the key exists in redis with the value specified

    name
        Redis key to manage

    value
        Data to persist in key

    expire
        Sets time to live for key in seconds

    expireat
        Sets expiration time for key via UNIX timestamp, overrides `expire`
    unameuchangesuresultu Key already set to defined valueucommentu
redis.get_keyu
redis.set_keyu
Value updateduKey updated to new valueuredis.expireatuKey expires at {0}uexpireaturedis.expireuTTL set to {0} secondsuexpire(tTrueRtformat(tnametvaluetexpiretexpireattconnection_argstrettold_key((s8/usr/lib/python2.7/site-packages/salt/states/redismod.pytstring.s 


cK@s�i|d6id6td6dd6}|r�t|t�sOt|d<d|d<|Sg|D]}td||�rV|^qV}t|�s�|Std||�||dd	<d
|d<|Std||�r�td||�d|d<|g|dd	<n|S(u�
    Ensure key absent from redis

    name
        Key to ensure absent from redis

    keys
        list of keys to ensure absent, name will be ignored if this is used
    unameuchangesuresultuKey(s) specified already absentucommentu `keys` not formed as a list typeuredis.existsuredis.deleteudeleteduKeys deleteduKey deleted(Rt
isinstancetlistRRtlen(R	tkeysR
Rtkeytdelete_list((s8/usr/lib/python2.7/site-packages/salt/states/redismod.pytabsentTs,







c
K@ski|d6id6td6dd6}tj|�}td||||�}|dtd�kr�t|d<d	j|�|d<|Std
|�}||kr�t|d<dj|�|d<|Stdtkr�d
j||d�|d<d|d<|S|j|�td|�td
|�}	|	|kr2|St|d<i|d6|	d6|d<dj|�|d<|S(u
    Set this redis instance as a slave.

    .. versionadded: 2016.3.0

    name
        Master to make this a slave of

    sentinel_host
        Ip of the sentinel to check for the master

    sentinel_port
        Port of the sentinel to check for the master

    unameuchangesuresultuFailed to setup slaveucommenturedis.sentinel_get_master_ipumaster_hostunetwork.ip_addrsuMinion is the master: {0}uredis.get_master_ipu#Minion already slave of master: {0}utestu'Minion will be made a slave of {0}: {1}uhostu
redis.slaveofuoldunewu,Minion successfully connected to master: {0}N(RtcopyRRRt__opts__tNonetupdate(
R	t
sentinel_hostt
sentinel_porttsentinel_passwordR
Rtkwargstsentinel_mastertfirst_mastertcurrent_master((s8/usr/lib/python2.7/site-packages/salt/states/redismod.pytslaveofxs<






(t__doc__t
__future__RRRRRRRRRR#(((s8/usr/lib/python2.7/site-packages/salt/states/redismod.pyt<module>s		&$

Zerion Mini Shell 1.0