%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/tops/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/tops/reclass_adapter.pyo

�
���^c@@s�dZddlmZmZmZddlZddlmZmZm	Z	ddl
mZddlm
Z
dZed�Zd	�ZdS(
u}
Read tops data from a reclass database

.. |reclass| replace:: **reclass**

This :ref:`master_tops <master-tops-system>` plugin provides access to
the |reclass| database, such that state information (top data) are retrieved
from |reclass|.

You can find more information about |reclass| at
http://reclass.pantsfullofunix.net.

To use the plugin, add it to the ``master_tops`` 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

    master_tops:
      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 ``ext_pillar`` 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_literalsN(tprepend_reclass_source_pathtfilter_out_source_path_optiontset_inventory_base_uri_default(tSaltInvocationError(tsixureclasscC@shyddl}tSWnMtk
rc|r.tStjdi�jdi�}t|�tdt�SXdS(Niumaster_topsureclasstretry(	treclasst__virtualname__tImportErrortFalset__opts__tgetRt__virtual__tTrue(RR	topts((s=/usr/lib/python2.7/site-packages/salt/tops/reclass_adapter.pyREs

cK@suddlm}ddlm}yDtdd}t|�tt|�|dd}|||�SWn
tk
r�}dtj	|�kr�t
djtj
���qq�n�tk
r}d	tj	|�krtj	|�j�d
}t
dj|���qq�njtk
r@}dtj	|�kr:t
d��qq�n1|k
rp}t
d
jtj	|����nXdS(uC
    Query |reclass| for the top data (states of the minions).
    i(ttop(tReclassExceptionumaster_topsureclassuoptsuidu6master_tops.reclass: cannot find reclass module in {0}uunexpected keyword argumenti����u+master_tops.reclass: unexpected option: {0}u<master_tops.reclass: no configuration found in master configumaster_tops.reclass: {0}N(treclass.adapters.saltRtreclass.errorsRR
RRRRt	text_typeRtformattsystpatht	TypeErrortsplittKeyError(tkwargstreclass_topRtreclass_optst	minion_idtetarg((s=/usr/lib/python2.7/site-packages/salt/tops/reclass_adapter.pyRRs4

(t__doc__t
__future__RRRRtsalt.utils.reclassRRRtsalt.exceptionsRtsalt.extRR
RRR(((s=/usr/lib/python2.7/site-packages/salt/tops/reclass_adapter.pyt<module>0s

Zerion Mini Shell 1.0