%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s}dZddlmZmZmZddlmZddlmZm	Z	m
Z
ddlmZdZ
ed�Zd�Zd	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(tabsolute_importtprint_functiontunicode_literals(tSaltInvocationError(tprepend_reclass_source_pathtfilter_out_source_path_optiontset_inventory_base_uri_default(tsixureclasscC@s�yddl}tSWnvtk
r�}|r0tSxLtjdg�D]8}d|kr[qCnttj|��}t	|�PqCWt
dt�SXdS(Niu
ext_pillarureclasstretry(treclasst__virtualname__tImportErrortFalset__opts__tgettnextRt
itervaluesRt__virtual__tTrue(RR	tetpillartopts((s?/usr/lib/python2.7/site-packages/salt/pillar/reclass_adapter.pyRHs
cK@s	ddlm}ddlm}y+t|�tt|�||||�SWn�tk
r�}dtj	|�kr�tj	|�j
�d}td|��q�natk
r�}dtj	|�kr�td��q�n(|k
r}td	j
|���nXd
S(uN
    Obtain the Pillar data from **reclass** for the given ``minion_id``.
    i(t
ext_pillar(tReclassExceptionuunexpected keyword argumenti����u'ext_pillar.reclass: unexpected option: uidu6ext_pillar.reclass: __opts__ does not define minion IDuext_pillar.reclass: {0}N(treclass.adapters.saltRtreclass.errorsRRRR
t	TypeErrorRt	text_typetsplitRtKeyErrortformat(t	minion_idRtkwargstreclass_ext_pillarRRtarg((s?/usr/lib/python2.7/site-packages/salt/pillar/reclass_adapter.pyR]s$


N(t__doc__t
__future__RRRtsalt.exceptionsRtsalt.utils.reclassRRRtsalt.extRR
RRR(((s?/usr/lib/python2.7/site-packages/salt/pillar/reclass_adapter.pyt<module>/s

Zerion Mini Shell 1.0