%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/pillar/ |
| Current File : //proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/pillar/reclass_adapter.pyc |
�
���^c @@ s} d Z d d l m Z m Z m Z d d l m Z d d l m Z m Z m
Z
d d l m Z d Z
e d � Z d � Z d S(
u�
Use the "reclass" database as a Pillar source
.. |reclass| replace:: **reclass**
This ``ext_pillar`` plugin provides access to the |reclass| database, such
that Pillar data for a specific minion are fetched using |reclass|.
You can find more information about |reclass| at
http://reclass.pantsfullofunix.net.
To use the plugin, add it to the ``ext_pillar`` list in the Salt master config
and tell |reclass| by way of a few options how and where to find the
inventory:
.. code-block:: yaml
ext_pillar:
- reclass:
storage_type: yaml_fs
inventory_base_uri: /srv/salt
This would cause |reclass| to read the inventory from YAML files in
``/srv/salt/nodes`` and ``/srv/salt/classes``.
If you are also using |reclass| as ``master_tops`` plugin, and you want to
avoid having to specify the same information for both, use YAML anchors (take
note of the differing data types for ``ext_pillar`` and ``master_tops``):
.. code-block:: yaml
reclass: &reclass
storage_type: yaml_fs
inventory_base_uri: /srv/salt
reclass_source_path: ~/code/reclass
ext_pillar:
- reclass: *reclass
master_tops:
reclass: *reclass
If you want to run reclass from source, rather than installing it, you can
either let the master know via the ``PYTHONPATH`` environment variable, or by
setting the configuration option, like in the example above.
i ( t absolute_importt print_functiont unicode_literals( t SaltInvocationError( t prepend_reclass_source_patht filter_out_source_path_optiont set_inventory_base_uri_default( t sixu reclassc C@ s� y d d l } t SWnv t k
r� } | r0 t SxL t j d g � D]8 } d | k r[ qC n t t j | � � } t | � PqC Wt
d t � SXd S( Ni u
ext_pillaru reclasst retry( t reclasst __virtualname__t ImportErrort Falset __opts__t gett nextR t
itervaluesR t __virtual__t True( R R t et pillart opts( ( s? /usr/lib/python2.7/site-packages/salt/pillar/reclass_adapter.pyR H s
c K@ s d d l m } d d l m } y+ t | � t t | � | | | | � SWn� t k
r� } d t j | � k r� t j | � j
� d } t d | � � q� na t k
r� } d t j | � k r� t d � � q� n( | k
r} t d j
| � � � n Xd
S( uN
Obtain the Pillar data from **reclass** for the given ``minion_id``.
i ( t
ext_pillar( t ReclassExceptionu unexpected keyword argumenti����u'