Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/common/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/common/file.pyo

�
�Udac@`s:ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZddlmZmZmZddlmZmZyddlZeZWnek
reZnXidd6dd	6d
d6dd
6dd6dd6dd6dd6dd6dd6dd6dd6dd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6Ze	j d.�Z!e	j d/�Z"e	j d0�Z#d1Z$d2Z%d3Z&d4�Z'd5�Z(d6�Z)d7�Z*d8e+fd9��YZ,d:d<d;��YZ-dS(=i(tabsolute_importtdivisiontprint_functionN(tcontextmanager(tto_bytest	to_nativetto_text(tbtbinary_typetnoatimetAtappendtat
compressedtctnocowtCtnodumptdtdirsynctDtextentstet	encryptedtEt	blocksizetht	immutabletitindexedtIt
journalledtjtinlinetNtzerotstsynchronoustStnotailttt	blockroottTtundeletetut
compressedrawtXtcompresseddirtytZs[+=-]s[^ugo]s[^rwxXstugo]i�iIi�cC`s)tjtjBtjBtj|�tj@S(s>is_executable(path)

    is the given path executable?

    :arg path: The path of the file to check.

    Limitations:

    * Does not account for FSACLs.
    * Most times we really want to know "Can the current user execute this
      file".  This function does not tell us that, only if any execute bit is set.
    (tstattS_IXUSRtS_IXGRPtS_IXOTHtostST_MODE(tpath((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pyt
is_executableAscC`s2g|D]!}|tkrtj|�^q}|S(N(tFILE_ATTRIBUTEStget(t
attributestattrtattribute_list((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pytformat_attributesYs.cC`s>gtj�D]\}}||kr
|^q
}dj|�S(Nt(R9titemstjoin(R;tkeyR<tflags((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pytget_flags_from_attributes^s1cC`sdtdtdd�dt�dt�dt�dt�dt�d	t�d
tddg��}|S(
NtmodettypetrawtownertgrouptseusertseroletseleveltsetypeR;taliasesR<(tdict(targ_spec((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pytget_file_arg_speccs						tLockTimeoutcB`seZRS((t__name__t
__module__(((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pyRRqstFileLockcB`s>eZdZd�Zedd��Zdd�Zd�ZRS(s
    Currently FileLock is implemented via fcntl.flock on a lock file, however this
    behaviour may change in the future. Avoid mixing lock types fcntl.flock,
    fcntl.lockf and module_utils.common.file.FileLock as it will certainly cause
    unwanted and/or unexpected behaviour
    cC`s
d|_dS(N(tNonetlockfd(tself((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pyt__init__|scc`s.z|j|||�dVWd|j�XdS(s.
        Context for lock acquisition
        N(tset_locktunlock(RXR7ttmpdirtlock_timeout((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pyt	lock_files	cC`s�tjj|djtjj|���}d}t}tjddkrRt}nt	|d�|_
|dkr�tj|j
tj
tjB�tj|tjtjB�tS|r\d}x}||kr6y?tj|j
tj
tjB�tj|tjtjB�tSWq�|k
r2tj|�||7}q�q�Xq�W|j
j�tdj|���ntj|j
tj
�tj|tjtjB�tS(sk
        Create a lock file based on path with flock to prevent other processes
        using given path.
        Please note that currently file locking only works when it's executed by
        the same user, I.E single user scenarios

        :kw path: Path (file) to lock
        :kw tmpdir: Path where to place the temporary .lock file
        :kw lock_timeout:
            Wait n seconds for lock acquisition, fail if timeout is reached.
            0 = Do not wait, fail if lock cannot be acquired immediately,
            Default is None, wait indefinitely until lock is released.
        :returns: True
        sansible-{0}.lockg�������?iitws{0} sec(R5R7RAtformattbasenametIOErrortsystversion_infotBlockingIOErrortopenRWtfcntltflocktLOCK_EXtLOCK_NBtchmodR1tS_IWRITEtS_IREADtTruettimetsleeptcloseRR(RXR7R\R]t	lock_pathtl_waittr_exceptionte_secs((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pyRZ�s4*	



cC`sL|js
tSy'tj|jtj�|jj�Wntk
rGnXtS(s�
        Make sure lock file is available for everyone and Unlock the file descriptor
        locked by set_lock

        :returns: True
        (RWRnRgRhtLOCK_UNRqt
ValueError(RX((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pyR[�s	
N(	RSRTt__doc__RYRRVR^RZR[(((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pyRUus	
0((.t
__future__RRRRFt
__metaclass__terrnoR5R1tretpwdtgrpRotshutilt	tracebackRgRct
contextlibRtansible.module_utils._textRRRtansible.module_utils.sixRRtselinuxRntHAVE_SELINUXtImportErrortFalseR9tcompiletMODE_OPERATOR_REtUSERS_REtPERMS_REt
_PERM_BITSt_EXEC_PERM_BITSt
_DEFAULT_PERMR8R>RDRQt	ExceptionRRRU(((sD/usr/lib/python2.7/site-packages/ansible/module_utils/common/file.pyt<module>sj



				

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