File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/wheel/__pycache__/__init__.cpython-310.pyc
o
;j� � @ sf d Z ddlmZ ddlZddlZddlZddlZddlZddl ZG dd� dej
jjej
jj
�ZeZdS )z+
Modules used to control the master itself
� )�MappingNc sx e Zd ZdZdZdZddd�Zdd� Zdd � Zd
d� Z dd
� Z
dd� Zddd�Zdd� Z
d� fdd� Z� ZS )�WheelClienta�
An interface to Salt's wheel modules
:ref:`Wheel modules <all-salt.wheel>` interact with various parts of the
Salt Master.
Importing and using ``WheelClient`` must be done on the same machine as the
Salt Master and it must be done using the same user that the Salt Master is
running as. Unless :conf_master:`external_auth` is configured and the user
is authorized to execute wheel functions: (``@wheel``).
Usage:
.. code-block:: python
import salt.config
import salt.wheel
opts = salt.config.master_config('/etc/salt/master')
wheel = salt.wheel.WheelClient(opts)
�wheelNc C s� t jjjj| ||d� t jjjj| ||d� || _|pi | _d | _t j j
�� | _t j jj
d| jd | jdd�| _t jj|| jd�| _d S )N)�contextZmasterZsock_dirF)�opts�listen)�salt�client�mixins�SyncClientMixin�__init__�AsyncClientMixinr r �event�utils�userZget_specific_userZ salt_userZ get_event�loaderZwheels� functions)�selfr r � r �G/opt/saltstack/salt/lib/python3.10/site-packages/salt/wheel/__init__.pyr * s
�zWheelClient.__init__c C sV | j d ur
| j �� d | _ t| d�r'| jd ur)t| jd�r"| j�� i | _d S d S d S )Nr �destroy)r r �hasattrr �r r r r r 6 s
�zWheelClient.destroyc C s | S �Nr r r r r � __enter__? s zWheelClient.__enter__c G s | � � d S r )r )r �argsr r r �__exit__B s zWheelClient.__exit__c K s"