%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/salt/states/augeas.pyo |
�
���^c @@ s� 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 m Z d d l m Z e j e � Z d � Z d � Z d � Z d d d d d � Z d S(
ut
Configuration management using Augeas
.. versionadded:: 0.17.0
This state requires the ``augeas`` Python module.
.. _Augeas: http://augeas.net/
Augeas_ can be used to manage configuration files.
.. warning::
Minimal installations of Debian and Ubuntu have been seen to have packaging
bugs with python-augeas, causing the augeas module to fail to import. If
the minion has the augeas module installed, and the state fails with a
comment saying that the state is unavailable, first restart the salt-minion
service. If the problem persists past that, the following command can be
run from the master to determine what is causing the import to fail:
.. code-block:: bash
salt minion-id cmd.run 'python -c "from augeas import Augeas"'
For affected Debian/Ubuntu hosts, installing ``libpython2.7`` has been
known to resolve the issue.
i ( t absolute_importt print_functiont unicode_literalsN( t six( t
METHOD_MAPc C@ s d t k r d St S( Nu augeas.executeu augeas( t __salt__t False( ( ( s6 /usr/lib/python2.7/site-packages/salt/states/augeas.pyt __virtual__1 s c C@ sQ t j j | � s | d k r7 | d k r3 d } n | St t j j | � � Sd S( uA
Recursively workout the file name from an augeas change
u /N( t ost patht isfilet Nonet _workout_filenamet dirname( t filename( ( s6 /usr/lib/python2.7/site-packages/salt/states/augeas.pyR 5 s
c C@ s� d } x�| D]|} y| j d d � \ } } | t k rX d j | � } t | � � n t | } t j j j | � } | d k r� | d } n | \ } } } | j d � s� d
j | � } t | � � n t
j d d | � } | d k r| | k rd
j | | � } t | � � qn | } Wq
t t f k
r�}
t
j |
� d t � k rjd j | � } n t j |
� } t | � � q
Xq
Wt | � } | S( u�
Ensure all changes are fully qualified and affect only one file.
This ensures that the diff output works and a state change is not
incorrectly reported.
u i u"