File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/tops/__pycache__/reclass_adapter.cpython-310.pyc
Back
o ;jk � @ sF d Z ddlZddlmZ ddlmZmZmZ dZddd�Z d d � Z dS )a} 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. � N)�SaltInvocationError)�filter_out_source_path_option�prepend_reclass_source_path�set_inventory_base_uri_default�reclassFc C sR zdd l }tW S ty( | rY dS t�di ��di �}t|� tdd� Y S w )Nr F�master_topsr T)�retry)r �__virtualname__�ImportError�__opts__�getr �__virtual__)r r �opts� r �M/opt/saltstack/salt/lib/python3.10/site-packages/salt/tops/reclass_adapter.pyr C s �r c K s" ddl m} ddlm} ztd d }t|� tt| � | d d }||fi |��W S tyE } zdt|�v r@t dt j� ���� d }~w tyf } zd t|�v rat|�� � d }t d|� ���� d }~w ty| } zdt|�v rwt d ��� d }~w |y� } z t dt|�� ���d }~ww )zC Query |reclass| for the top data (states of the minions). r )�top)�ReclassExceptionr r r �idz3master_tops.reclass: cannot find reclass module in Nzunexpected keyword argument���z(master_tops.reclass: unexpected option: z<master_tops.reclass: no configuration found in master configzmaster_tops.reclass: )Zreclass.adapters.saltr Zreclass.errorsr r r r r �strr �sys�path� TypeError�split�KeyError)�kwargsZreclass_topr Zreclass_optsZ minion_id�e�argr r r r Q s@ �������r )F)�__doc__r Zsalt.exceptionsr Zsalt.utils.reclassr r r r r r r r r r �<module> s 0
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings