%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/lib/python2.7/site-packages/salt/spm/pkgfiles/
Upload File :
Create Path :
Current File : //proc/self/root/lib/python2.7/site-packages/salt/spm/pkgfiles/local.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZ	ddl
Z	ddlZ	ddlm
Z
eje�ZdZd�Zdd
�Zdd�Zdd�Zdd�Zd�Zd�ZdS(uj
This module allows SPM to use the local filesystem to install files for SPM.

.. versionadded:: 2015.8.0
i(tabsolute_importtprint_functiontunicode_literalsN(tsixucudugulurusumcK@sstd}td}td}x9|||fD](}tjj|�s.tj|�q.q.Wi|d6|d6|d6S(u2
    Initialize the directories for the files
    uformula_pathupillar_pathureactor_path(t__opts__tostpathtexiststmakedirs(tkwargstformula_pathtpillar_pathtreactor_pathtdir_((s;/usr/lib/python2.7/site-packages/salt/spm/pkgfiles/local.pytinit"s


c
C@s|dkrt�}ntjtjd��}g}x�|D]�}|j�rUq=n|jd|�}|jjdj	|�d�}|j
|�s�q=n|jj
dj	|��r
|dkr�tjj
tjj|d|jd	d��}	q�tjj
|d
|�}	n�|jdj	|�krPdj	|�}tjj
|d
|�}	nw|jd�r}tjj
tjj|�}	nJ|jd�r�tjj
|d|j�}	ntjj
|d
|j�}	tjj|	�r=|j|	�tdstjd|	�qq=q=W|S(u1
    Check the filesystem for existing files
    u
spm_node_typeu
top_level_diru{0}/uu{0}/_umasteruminionuextmodsu_uformula_pathu{0}/pillar.exampleu{0}.sls.origupillar_pathu-confu-reactorureactor_pathuforceu!%s already exists, not installingN(umasteruminion(tNoneRRt	text_typeRtgettisdirtnametreplacetformatt
startswithRRtjointsalttsyspathst	CACHE_DIRtendswitht
CONFIG_DIRRtappendtlogterror(
tpackaget	pkg_filestformula_deftconnt	node_typetexisting_filestmemberttldtnew_nametout_file((s;/usr/lib/python2.7/site-packages/salt/spm/pkgfiles/local.pytcheck_existing3s@
		

c
C@s&|j|krtS|d#kr+t�}ntjtjd��}|d}|jd|�}|jjdj	|�dd�}|j
|�r�|j
d�r�|j
d�r�|j
d	�r�tjd
|�tSx�|jdg�D]�}	d}
xUt
D]M}|	j
dj	|��r�|	jd
d�d}
|	jd
d�d}	q�q�W|
r�||	kr�|
d$krvtd}q�|
d%kr�q�q�q�W|jj
dj	|��r|d&kr�|jjdj	|�d�|_tjjtjj|d�}q�|jjdj	|�d�|_n�|jdj	|�krPdj	|�|_|d}n[|jd�r�|jjdj	|�d�|_tjj}n|jd�r�td }n|jjd!�}t|�dkr�|d|dkr�d!j|d�|_ntjd"|j|�|j||�|S('u2
    Install a single file to the file system
    u
spm_node_typeuformula_pathu
top_level_diru{0}/uiu_upillar.exampleuREADMEu-%s not in top level directory, not installingufilesu{0}|u|iucuduguluru
spm_share_dirusumu{0}/_umasteruminionuextmodsu{0}/pillar.exampleu{0}.sls.origupillar_pathu-confu-reactorureactor_pathu/u Installing package file %s to %sN(ucudugulur(usum(umasteruminion(RtFalseRRRRRRRRRRtdebugt
FILE_TYPEStsplitRRRRRRRRtlentextract(
R tformula_tarR&R"R#R$tout_pathR'R(tlinettagtftypetcomps((s;/usr/lib/python2.7/site-packages/salt/spm/pkgfiles/local.pytinstall_filegsZ
!  


!		$
!
&cC@s9|dkrt�}ntjd|�tj|�dS(u3
    Remove a single file from the file system
    uRemoving package file %sN(RRRR,Rtremove(RR#((s;/usr/lib/python2.7/site-packages/salt/spm/pkgfiles/local.pytremove_file�scC@sgtjj|�rdStjjj|d��3}|jtjjj	|j
���|j�SWdQXdS(u0
    Get the hexdigest hash value of a file
    uurN(RRRRtutilstfilestfopentupdatetstringutilstto_bytestreadt	hexdigest(RthashobjR#tf((s;/usr/lib/python2.7/site-packages/salt/spm/pkgfiles/local.pyt	hash_file�s
"cC@stjj|�S(u6
    Check to see whether the file already exists
    (RRR(R((s;/usr/lib/python2.7/site-packages/salt/spm/pkgfiles/local.pytpath_exists�scC@stjj|�S(u6
    Check to see whether the file already exists
    (RRR(R((s;/usr/lib/python2.7/site-packages/salt/spm/pkgfiles/local.pyt
path_isdir�s(ucudugulurusum(t__doc__t
__future__RRRRtos.pathtloggingt
salt.syspathsRtsalt.utils.filestsalt.utils.stringutilstsalt.extRt	getLoggert__name__RR-RRR*R7R9RDRERF(((s;/usr/lib/python2.7/site-packages/salt/spm/pkgfiles/local.pyt<module>s"
	4E	

Zerion Mini Shell 1.0