Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/plugins/cache/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyo

�
�Udac@`s�ddlmZmZmZeZdZddlZddlZddl	m
Zddlm
Z
ddlmZmZddlmZddlmZydd	lmZmZWnek
r�e
d
��nXe�Zdefd��YZdS(
i(tabsolute_importtdivisiontprint_functions
    cache: redis
    short_description: Use Redis DB for cache
    description:
        - This cache uses JSON formatted, per host records saved in Redis.
    version_added: "1.9"
    requirements:
      - redis>=2.4.5 (python lib)
    options:
      _uri:
        description:
          - A colon separated string of connection information for Redis.
        required: True
        env:
          - name: ANSIBLE_CACHE_PLUGIN_CONNECTION
        ini:
          - key: fact_caching_connection
            section: defaults
      _prefix:
        description: User defined prefix to use when creating the DB entries
        default: ansible_facts
        env:
          - name: ANSIBLE_CACHE_PLUGIN_PREFIX
        ini:
          - key: fact_caching_prefix
            section: defaults
      _timeout:
        default: 86400
        description: Expiration timeout for the cache plugin data
        env:
          - name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
        ini:
          - key: fact_caching_timeout
            section: defaults
        type: integer
N(t	constants(tAnsibleError(tAnsibleJSONEncodertAnsibleJSONDecoder(tBaseCacheModule(tDisplay(tStrictRedistVERSIONslThe 'redis' python module (version 2.4.5 or newer) is required for the redis fact cache, 'pip install redis'tCacheModulecB`szeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�ZRS(
s
    A caching module backed by redis.

    Keys are maintained in a zset with their score being the timestamp
    when they are inserted. This allows for the usage of 'zremrangebyscore'
    to expire keys. This mechanism is used or a pattern matched 'scan' for
    performance.
    cO`s�g}yqtt|�j||�|jd�rL|jd�jd�}nt|jd��|_|jd�|_Wn`tk
r�t	j
ddd�tjr�tjjd�}nttj
�|_tj|_nXi|_t|�|_d|_dS(	Nt_urit:t_timeoutt_prefixsTRather than importing CacheModules directly, use ansible.plugins.loader.cache_loadertversions2.12tansible_cache_keys(tsuperRt__init__t
get_optiontsplittfloatRRtKeyErrortdisplayt
deprecatedtCtCACHE_PLUGIN_CONNECTIONtCACHE_PLUGIN_TIMEOUTtCACHE_PLUGIN_PREFIXt_cacheR	t_dbt	_keys_set(tselftargstkwargst
connection((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyRFs"
		cC`s|j|S(N(R(R!tkey((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyt	_make_key[scC`s{||jkrk|jj|j|��}|dkrL|j|�t�ntj|dt	�|j|<n|jj|�S(Ntcls(
RRtgetR&tNonetdeleteRtjsontloadsR(R!R%tvalue((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyR(^s
	cC`s�tj|dtdtdd�}|jdkr[|jj|j|�t|j�|�n|jj	|j|�|�t
ddkr�|jj|jt
j
�|�n#|jj|jit
j
�|6�||j|<dS(NR't	sort_keystindentiii(R+tdumpsRtTrueRRtsetexR&tinttsetR
tzaddR ttimeR(R!R%R-tvalue2((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyR4ls!+"#cC`sB|jdkr>tj�|j}|jj|jd|�ndS(Ni(RR6RtzremrangebyscoreR (R!t
expiry_age((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyt_expire_keyszscC`s#|j�|jj|jdd�S(Nii����(R:RtzrangeR (R!((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pytkeyss
cC`s&|j�|jj|j|�dk	S(N(R:RtzrankR R)(R!R%((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pytcontains�s
cC`sO||jkr|j|=n|jj|j|��|jj|j|�dS(N(RRR*R&tzremR (R!R%((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyR*�s
cC`s(x!|j�D]}|j|�q
WdS(N(R<R*(R!R%((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pytflush�scC`s7t�}x'|j�D]}|j|�||<qW|S(N(tdictR<R((R!tretR%((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pytcopy�s	cC`st�S(N(RA(R!((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyt__getstate__�scC`s|j�dS(N(R(R!tdata((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyt__setstate__�s(t__name__t
__module__t__doc__RR&R(R4R:R<R>R*R@RCRDRF(((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyR=s											(t
__future__RRRttypet
__metaclass__t
DOCUMENTATIONR6R+tansibleRRtansible.errorsRtansible.parsing.ajsonRRtansible.plugins.cacheRtansible.utils.displayRtredisR	R
tImportErrorRR(((s?/usr/lib/python2.7/site-packages/ansible/plugins/cache/redis.pyt<module>s%
	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]