File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/tops/__pycache__/cobbler.cpython-310.pyc
o
�N�gm � @ s6 d Z ddlZddlZe�e�Zdddd�Zdd� ZdS )a
Cobbler Tops
============
Cobbler Tops is a master tops subsystem used to look up mapping information
from Cobbler via its API. The same cobbler.* parameters are used for both
the Cobbler tops and Cobbler pillar modules.
.. code-block:: yaml
master_tops:
cobbler: {}
cobbler.url: https://example.com/cobbler_api #default is http://localhost/cobbler_api
cobbler.user: username # default is no username
cobbler.password: password # default is no password
Module Documentation
====================
� Nzhttp://localhost/cobbler_api)�cobbler.url�cobbler.user�cobbler.passwordc K s� t d }t d }t d }| d d }t�d|� ztjj|dd�}|r)|�||� |�d |�}W n ty@ t� d
� i Y S w |d |d iS )
z3
Look up top data in Cobbler for a minion.
r r r �opts�idz'Querying cobbler for information for %rT)Z
allow_noneNzCould not connect to cobbler.�statusZmgmt_classes)
�__opts__�log�info�xmlrpc�clientZServerZloginZget_blended_data� Exception� exception)�kwargs�url�user�passwordZ minion_idZserver�data� r �E/opt/saltstack/salt/lib/python3.10/site-packages/salt/tops/cobbler.py�top# s
�r ) �__doc__�loggingZ
xmlrpc.clientr � getLogger�__name__r r r r r r r �<module> s
�