File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/tops/__pycache__/ext_nodes.cpython-310.pyc
Back
o ;j� � @ sj d Z ddlZddlZddlZddlZddlZejj� � r#ddl mZ nej Ze�e�Zdd� Zdd� ZdS )a� External Nodes Classifier ========================= The External Nodes Classifier is a master tops subsystem that retrieves mapping information from major configuration management systems. One of the most common external nodes classifiers system is provided by Cobbler and is called ``cobbler-ext-nodes``. The cobbler-ext-nodes command can be used with this configuration: .. code-block:: yaml master_tops: ext_nodes: cobbler-ext-nodes It is noteworthy that the Salt system does not directly ingest the data sent from the ``cobbler-ext-nodes`` command, but converts the data into information that is used by a Salt top file. Any command can replace the call to 'cobbler-ext-nodes' above, but currently the data must be formatted in the same way that the standard 'cobbler-ext-nodes' does. See (admittedly degenerate and probably not complete) example: .. code-block:: yaml classes: - basepackages - database The above essentially is the same as a top.sls containing the following: .. code-block:: yaml base: '*': - basepackages - database base: '*': - basepackages - database � N)�escape_argumentc C s t d �d�r dS dS )z) Only run if properly configured �master_tops� ext_nodesTF)�__opts__�get� r r �G/opt/saltstack/salt/lib/python3.10/site-packages/salt/tops/ext_nodes.py�__virtual__? s r c K s� d| d vri S t jdd� tjtd d tjj�� du d�t | d d �g D �t j d d �}tjj�|j �}|s=t�d� i }d|v rH|d }nd }d|v rpt|d t�r_t|d �||<