%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/tops/ |
Current File : //lib/python2.7/site-packages/salt/tops/reclass_adapter.pyo |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l m Z m Z m Z d d l m Z d d l m Z d Z e d � Z d � Z d S( 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 ( t absolute_importt print_functiont unicode_literalsN( t prepend_reclass_source_patht filter_out_source_path_optiont set_inventory_base_uri_default( t SaltInvocationError( t sixu reclassc C@ sh y d d l } t SWnM t k rc | r. t St j d i � j d i � } t | � t d t � SXd S( Ni u master_topsu reclasst retry( t reclasst __virtualname__t ImportErrort Falset __opts__t getR t __virtual__t True( R R t opts( ( s= /usr/lib/python2.7/site-packages/salt/tops/reclass_adapter.pyR E s c K@ su d d l m } d d l m } yD t d d } t | � t t | � | d d } | | | � SWn t k r� } d t j | � k r� t d j t j � � � qq� n� t k r} d t j | � k rt j | � j � d } t d j | � � � qq� nj t k r@} d t j | � k r:t d � � qq� n1 | k rp} t d j t j | � � � � n Xd S( uC Query |reclass| for the top data (states of the minions). i ( t top( t ReclassExceptionu master_topsu reclassu optsu idu6 master_tops.reclass: cannot find reclass module in {0}u unexpected keyword argumenti����u+ master_tops.reclass: unexpected option: {0}u<