%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/lib/python2.7/site-packages/salt/fileserver/ |
| Current File : //proc/self/root/proc/3522530/root/lib/python2.7/site-packages/salt/fileserver/roots.pyo |
�
���^c @@ s2 d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l
Z d d l Z d d l Z d d l
Z d d l Z d d l Z d d l Z d d l Z d d l m Z e j e � Z d d � Z d � Z d � Z d � Z d
� Z d � Z d � Z d
� Z d � Z d � Z d S( u�
The default file server backend
This fileserver backend serves files from the Master's local filesystem. If
:conf_master:`fileserver_backend` is not defined in the Master config file,
then this backend is enabled by default. If it *is* defined then ``roots`` must
be in the :conf_master:`fileserver_backend` list to enable this backend.
.. code-block:: yaml
fileserver_backend:
- roots
Fileserver environments are defined using the :conf_master:`file_roots`
configuration option.
i ( t absolute_importt print_functiont unicode_literalsN( t sixu basec K@ s� d | k r | j d � n t j j | � } i d d 6d d 6} t j j | � rX | S| t d k r� d t d k r� t j d | � d } q� | Sn d � } d | k rRy t d | t | d � } Wn# t k
r� | St
k
r� | SXt j j | | � } t j j | � rNt
j j t | � rN| | d <| | d <| | � S| Sxq t d | D]a } t j j | | � } t j j | � rat
j j t | � ra| | d <| | d <| | � SqaW| S(
u7
Search the environment for the relative path.
u envu u pathu relu
file_rootsu __env__u: salt environment '%s' maps to __env__ file_roots directoryc S@ s9 y! t t j | d � � | d <Wn t k
r4 n X| S( u0
Stat the file and, assuming no errors were found, convert the stat
result to a list of values and add to the return dict.
Converting the stat result to a list, the elements of the list
correspond to the following stat_result params:
0 => st_mode=33188
1 => st_ino=10227377
2 => st_dev=65026
3 => st_nlink=1
4 => st_uid=1000
5 => st_gid=1000
6 => st_size=1056233
7 => st_atime=1468284229
8 => st_mtime=1456338235
9 => st_ctime=1456338235
u pathu stat( t listt ost statt Exception( t fnd( ( s9 /usr/lib/python2.7/site-packages/salt/fileserver/roots.pyt _add_file_stat<