HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/transport/__pycache__/base.cpython-310.pyc
o

�N�g�@s�ddlZddlZddlZdZdd�Zdd�Zdd�Zd	d
�ZGdd�de	�Z
Gd
d�d�ZGdd�de�ZGdd�d�Z
Gdd�de
�ZGdd�d�ZGdd�de�ZGdd�de�ZdS)�N)�zeromq�tcpcKs�d}d|vr|d}nd|�di��di�vr|ddd}|dkr.ddl}|jj�|�S|dkr=ddl}|jj�|�S|dkrNddl}|jj	�
|�}dStd��)	Nr�	transport�pillar�masterrr�localz,Channels are only defined for ZeroMQ and TCP)�get�salt.transport.zeromqrr�
RequestServer�salt.transport.tcprZTCPReqServer�salt.transport.localrZLocalServerChannel�	Exception)�opts�kwargs�ttype�saltr�r�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/transport/base.py�request_servers
rcCs�d}d|vr|d}nd|�di��di�vr|ddd}|dkr0ddl}|jjj||d�S|dkrAddl}|jjj||d�Std��)	Nrrrrr)�io_looprz)Channels are only defined for tcp, zeromq)	rr	rr�
RequestClientrrZTCPReqClientr
�rrrrrrr�request_client&s
rcKs�d}d|vr|d}nd|�di��di�vr|ddd}|dkr2ddl}|jjj|fi|��S|dkrAddl}|jj�|�S|dkrTddl}|jj	j
|fi|��Std|����)	Nrrrrrrr�Transport type not found: )rr	rr�
PublishServerrrZTCPPublishServerrrZLocalPubServerChannelr
)rrrrrrr�publish_server8s
rcCs�d}d|vr|d}nd|�di��di�vr|ddd}|dkr/ddl}|jj�||�S|dkr?ddl}|jj�||�Std|����)Nrrrrrrr)	rr	rr�
PublishClientrrZTCPPubClientr
rrrr�publish_clientPs
rc@seZdZdZdS)�TransportWarningz
    Transport warning.
    N)�__name__�
__module__�__qualname__�__doc__rrrrrdsrc@s$eZdZdd�Zdd�Zdd�ZdS)�	TransportcOs@d�t��dd��|_t|d�sd|_t|d�sd|_dSdS)N�
����_closingF�_connect_called)�join�	traceback�format_stack�_trace�hasattrr&r'��self�argsrrrr�__init__ks


�zTransport.__init__cOs
d|_dS)NT)r'r-rrr�connectrs
zTransport.connectcCs@t|d�rt|dd�stjd|�d|j��t|d�dSdSdS)a�
        Warn the user if the transport's close method was never called.

        If the _closing attribute is missing we won't raise a warning. This
        prevents issues when class's dunder init method is called with improper
        arguments, and is later getting garbage collected. Users of this class
        should take care to call super() and validate the functionality with a
        test.
        r'r&TzUnclosed transport! z 
)�sourceN)�getattr�warnings�warnr+r�r.rrr�__del__vs

��zTransport.__del__N)rr r!r0r1r7rrrrr#jsr#csFeZdZdZ�fdd�Zejjjj	ddd��Z
dd�Zd	d
�Z�Z
S)rzx
    The RequestClient transport is used to make requests and get corresponding
    replies from the RequestServer.
    c�t���dS�N��superr0�r.rrr��	__class__rrr0��zRequestClient.__init__�<cC�t�)zN
        Send a request message and return the reply from the server.
        ��NotImplementedError)r.�load�timeoutrrr�send�szRequestClient.sendcCrA)z'
        Close the connection.
        rBr6rrr�close��zRequestClient.closecCrA)z1
        Connect to the server / broker.
        rBr6rrrr1�rHzRequestClient.connect)r@)rr r!r"r0r�ext�tornado�gen�	coroutinerFrGr1�
__classcell__rrr=rr�s
rc@s eZdZdZdd�Zdd�ZdS)r
z�
    The RequestServer transport is responsible for handling requests from
    RequestClients and sending replies to those requests.
    cC�dSr9r)r.rrrrr0��zRequestServer.__init__cCrA)z:
        Close the underlying network connection.
        rBr6rrrrG�rHzRequestServer.closeN)rr r!r"r0rGrrrrr
�sr
c@seZdZdd�Zdd�ZdS)�DaemonizedRequestServercCrAr9rB�r.Zprocess_managerrrr�pre_fork�rOz DaemonizedRequestServer.pre_forkcCrA)z�
        The message handler is a coroutine that will be called called when a
        new request comes into the server. The return from the message handler
        will be send back to the RequestClient
        rB)r.Zmessage_handlerrrrr�	post_fork�sz!DaemonizedRequestServer.post_forkN)rr r!rRrSrrrrrP�srPc@seZdZdZdd�ZdS)rz\
    The PublishServer publishes messages to PublishClients or to a borker
    service.
    cKrA)z�
        Publish "load" to minions. This send the load to the publisher daemon
        process with does the actual sending to minions.

        :param dict load: A load to be sent across the wire to minions
        rB)r.�payloadrrrr�publish��zPublishServer.publishN)rr r!r"rUrrrrr�src@s&eZdZdZdd�Z		ddd�ZdS)�DaemonizedPublishServerz=
    PublishServer that has a daemon associated with it.
    cCrAr9rBrQrrrrR�rOz DaemonizedPublishServer.pre_forkNcCrA)a�
        If a daemon is needed to act as a broker implement it here.

        :param func publish_payload: A method used to publish the payload
        :param func presence_callback: If the transport support presence
                                       callbacks call this method to notify the
                                       channel of a client's presence
        :param func remove_presence_callback: If the transport support presence
                                              callbacks call this method to
                                              notify the channel a client is no
                                              longer present
        rB)r.Zpublish_payloadZpresence_callbackZremove_presence_callbackrrr�publish_daemon�sz&DaemonizedPublishServer.publish_daemon�NN)rr r!r"rRrXrrrrrW�s�rWcsXeZdZdZ�fdd�Zdd�Zejjj	j
	ddd��Zd	d
�Zdd�Z
d
d�Z�ZS)rzY
    The PublishClient receives messages from the PublishServer and runs a callback.
    cr8r9r:r<r=rrr0�r?zPublishClient.__init__cCrA)zX
        Add a message handler when we receive a message from the PublishServer
        rB)r.�callbackrrr�on_recv�rHzPublishClient.on_recvNcCrA)zQ
        Create a network connection to the the PublishServer or broker.
        rB)r.Zpublish_portZconnect_callbackZdisconnect_callbackrrrr1�rVzPublishClient.connectcCrA)z9
        Close the underlying network connection
        rBr6rrrrGrHzPublishClient.closecCs|Sr9rr6rrr�	__enter__rOzPublishClient.__enter__cCrNr9r)r.�exc_typeZexc_valZexc_tbrrr�__exit__rOzPublishClient.__exit__rY)rr r!r"r0r[rrIrJrKrLr1rGr\r^rMrrr=rr�s
�r)r)r4Zsalt.ext.tornado.genrZ
TRANSPORTSrrrr�Warningrr#rr
rPrrWrrrrr�<module>s