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/__init__.pyo

�
�Udac@`scddlmZmZmZeZddlZddlZddlZddl	Z	ddl
mZmZddl
mZddlmZddlmZddlmZmZddlmZdd	lmZdd
lmZddlmZddlm Z!e�Z"d
e!fd��YZ defd��YZ#de#fd��YZ$defd��YZ%dS(i(tabsolute_importtdivisiontprint_functionN(tABCMetatabstractmethod(t	constants(tAnsibleError(twith_metaclass(tto_bytestto_text(tMutableMapping(t
AnsiblePlugin(tcache_loader(tDisplay(t	FactCacheRcB`seZdZd�ZRS(s`
    This is for backwards compatibility.  Will be removed after deprecation.  It was removed as it
    wasn't actually part of the cache plugin API.  It's actually the code to make use of cache
    plugins, not the cache plugin itself.  Subclassing it wouldn't yield a usable Cache Plugin and
    there was no facility to use it as anything else.
    cO`s0tjddd�tt|�j||�dS(Ns�ansible.plugins.cache.FactCache has been moved to ansible.vars.fact_cache.FactCache.  If you are looking for the class to subclass for a cache plugin, you want ansible.plugins.cache.BaseCacheModule or one of its subclasses.tversions2.12(tdisplayt
deprecatedtsuperRt__init__(tselftargstkwargs((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR/s(t__name__t
__module__t__doc__R(((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR(stBaseCacheModulecB`s�eZeZd�Zed��Zed��Zed��Zed��Z	ed��Z
ed��Zed��ZRS(cO`sF|jjd�d|_tt|�j�|jd|d|�dS(Nt.i����tvar_optionstdirect(Rtsplitt
_load_nameRRRtset_options(RRR((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR=scC`sdS(N((Rtkey((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pytgetBscC`sdS(N((RR!tvalue((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pytsetFscC`sdS(N((R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pytkeysJscC`sdS(N((RR!((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pytcontainsNscC`sdS(N((RR!((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pytdeleteRscC`sdS(N((R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pytflushVscC`sdS(N((R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pytcopyZs(
RRRt_displayRRR"R$R%R&R'R(R)(((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR8s	tBaseFileCacheModulecB`s�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zed
��Zed��ZRS(s8
    A caching module backed by file based storage.
    cO`s�yPtt|�j||�|j|jd��|_t|jd��|_Wn8tk
r�|jt	j
�|_tt	j�|_nX|jj
d�d|_i|_|j�dS(Nt_urit_timeoutRi����(RR+Rt_get_cache_connectiont
get_optiont
_cache_dirtfloatR-tKeyErrortCtCACHE_PLUGIN_CONNECTIONtCACHE_PLUGIN_TIMEOUTRRtplugin_namet_cachetvalidate_cache_connection(RRR((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRcs
	cC`sA|r=y tjjtjj|��SWq=tk
r9q=XndS(N(tostpatht
expandusert
expandvarst	TypeError(Rtsource((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR.ps
 
cC`s�|jstd|j��ntjj|j�s�ytj|j�Wq�ttfk
r�}td|j|jt	|�f��q�XnWxTtj
tjtjfD]:}tj
|j|�s�td|j|jf��q�q�WdS(Nswerror, '%s' cache plugin requires the 'fact_caching_connection' config option to be set (to a writeable directory path)sCerror in '%s' cache plugin while trying to create cache dir %s : %sseerror in '%s' cache, configured path (%s) does not have necessary permissions (rwx), disabling plugin(R0RR6R9R:texiststmakedirstOSErrortIOErrorRtR_OKtW_OKtX_OKtaccess(Rtetx((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR8ws	,cC`sE|jd�}|r.d|j||f}nd|j|f}|S(Nt_prefixs%s/%s%ss%s/%s(R/R0(RR!tprefixt	cachefile((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyt_get_cache_file_name�s
cC`s:||jkr*|j|�s*|dkr3t�n|j|�}y |j|�}||j|<Wq*tk
r�}tjd|j|t	|�f�|j
|�td|��q*tt
fk
r�}tjd|j|t	|�f�t�q*tk
r&}td|t	|�f��q*Xn|jj|�S(s� This checks the in memory cache first as the fact was not expired at 'gather time'
        and it would be problematic if the key did expire after some long running tasks and
        user gets 'undefined' error in the same play tslerror in '%s' cache plugin while trying to read %s : %s. Most likely a corrupt file, so erasing and failing.s�The cache file %s was corrupt, or did not otherwise contain valid data. It has been removed, so you can re-run your command now.s7error in '%s' cache plugin while trying to read %s : %ss*Error while decoding the cache file %s: %s(R7thas_expiredR2RLt_loadt
ValueErrorRtwarningR6RR'RRARBt	ExceptionR"(RR!RKR#RG((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR"�s&		

#	#cC`ss||j|<|j|�}y|j||�Wn<ttfk
rn}tjd|j|t|�f�nXdS(Ns;error in '%s' cache plugin while trying to write to %s : %s(	R7RLt_dumpRARBRRQR6R(RR!R#RKRG((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR$�s
cC`s�|jdkrtS|j|�}ytj|�}WnVttfk
r�}|jtjkrctSt	j
d|j|t|�f�tSnXt
j
�|j|jkr�tS||jkr�|j|=ntS(Nis7error in '%s' cache plugin while trying to stat %s : %s(R-tFalseRLR9tstatRARBterrnotENOENTRRQR6Rttimetst_mtimeR7tTrue(RR!RKtstRG((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRN�s#
cC`sUg}xHtj|j�D]4}|jd�p:|j|�s|j|�qqW|S(NR(R9tlistdirR0t
startswithRNtappend(RR%tk((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR%�s
cC`s�|j|�}||jkr"tS|j|�r5tSytj|�tSWnRttfk
r�}|j	t	j
krxtStjd|j
|t|�f�nXdS(Ns7error in '%s' cache plugin while trying to stat %s : %s(RLR7RZRNRTR9RURARBRVRWRRQR6R(RR!RKRG((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR&�s
cC`sZy|j|=Wntk
r!nXytj|j|��Wnttfk
rUnXdS(N(R7R2R9tremoveRLRARB(RR!((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR'�s
cC`s1i|_x!|j�D]}|j|�qWdS(N(R7R%R'(RR!((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR(�s	cC`s7t�}x'|j�D]}|j|�||<qW|S(N(tdictR%R"(RtretR!((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR)�s	cC`sdS(s�
        Read data from a filepath and return it as a value

        :arg filepath: The filepath to read from.
        :returns: The value stored in the filepath

        This method reads from the file on disk and takes care of any parsing
        and transformation of the data before returning it.  The value
        returned should be what Ansible would expect if it were uncached data.

        .. note:: Filehandles have advantages but calling code doesn't know
            whether this file is text or binary, should be decoded, or accessed via
            a library function.  Therefore the API uses a filepath and opens
            the file inside of the method.
        N((Rtfilepath((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRO�scC`sdS(s�
        Write data to a filepath

        :arg value: The value to store
        :arg filepath: The filepath to store it at
        N((RR#Rc((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRSs(RRRRR.R8RLR"R$RNR%R&R'R(R)RRORS(((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR+_s	
					
				
		tCachePluginAdjudicatorcB`s�eZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zdd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(sC
    Intermediary between a cache dictionary and a CacheModule
    tmemorycK`sPi|_i|_tj||�|_|jsCtd|��n||_dS(Ns%Unable to load the cache plugin (%s).(R7t
_retrievedRR"t_pluginRt_plugin_name(RR6R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRs			cC`s#|j|jkr|j�ndS(N(RfR7t	set_cache(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pytupdate_cache_if_changed$scC`sMx1|jj�D] }|jj||j|�qWtj|j�|_dS(N(R7R%RgR$R)tdeepcopyRf(Rttop_level_cache_key((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRi(scC`s7x0|jj�D]}|jj|�|j|<qWdS(N(RgR%R"R7(RR!((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pytload_whole_cache-scC`s
t|j�S(N(R	R7(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyt__repr__1scC`st|j��S(N(titerR%(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyt__iter__4scC`st|j��S(N(tlenR%(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyt__len__7scC`sRt}t||jk||jk|jdk|jj|�g�rNt}n|S(NRe(RTtallR7RfRhRgR&RZ(RR!tload((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyt_do_load_key:s	cC`sb|j|�rWy|jj|�|j|<Wntk
r?qWX|j||j|<n|j|S(N(RuRgR"R7R2Rf(RR!((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyt__getitem__Es
cC`sl|j|�rYy|jj|�|j|<Wntk
rA}qYX|j||j|<n|jj||�S(N(RuRgR"R7R2Rf(RR!tdefaultRG((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR"OscC`s
|jj�S(N(R7titems(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRxYscC`s
|jj�S(N(R7tvalues(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRy\scC`s
|jj�S(N(R7R%(R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR%_scG`s-|r|jj||d�S|jj|�S(Ni(R7tpop(RR!R((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRzbscC`s|j|=dS(N(R7(RR!((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyt__delitem__gscC`s||j|<dS(N(R7(RR!R#((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyt__setitem__jscC`s7x'|jj�D]}|jj|�qWi|_dS(N(R7R%RgR'(RR!((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR(mscC`s|jj|�dS(N(R7tupdate(RR#((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyR}rsN(RRRRRjRiRmRnRpRrRuRvtNoneR"RxRyR%RzR{R|R(R}(((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyRds&
								

							(&t
__future__RRRttypet
__metaclass__R)R9RXRVtabcRRtansibleRR3tansible.errorsRtansible.module_utils.sixRtansible.module_utils._textRR	t/ansible.module_utils.common._collections_compatR
tansible.pluginsRtansible.plugins.loaderRtansible.utils.displayR
tansible.vars.fact_cacheRt
RealFactCacheRRR+Rd(((sB/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.pyt<module>s(	'�

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