????

Your IP : 216.73.217.84


Current Path : /usr/lib/python3.9/site-packages/rhn/__pycache__/
Upload File :
Current File : //usr/lib/python3.9/site-packages/rhn/__pycache__/rpclib.cpython-39.opt-1.pyc

a

	Z�iQ�@sjdZddlmZddlmZmZmZmZddl	m
Z
Gdd�de�ZGdd�dej
�Zd	d
�Zdd�ZdS)
z3.0.3-1.el9.cloudlinux-�N)�urlparse�
urlunparse�	splittype�	splithost)�
transportsc@seZdZdS)�MalformedURIErrorN)�__name__�
__module__�__qualname__�rr�./usr/lib/python3.9/site-packages/rhn/rpclib.pyr srcsReZdZdZd�fdd�	Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
�ZS)�Servera	uri [,options] -> a logical connection to an XML-RPC server

    uri is the connection point on the server, given as
    scheme://host/target.

    If the target part and the slash preceding it are both omitted,
    "/RPC2" is assumed.

    The following options can be given as keyword arguments:

        transport: a transport factory
        verbose: verbosity level
        proxy: use an HTTP proxy
        username: username for authenticated HTTP proxy
        password: password for authenticated HTTP proxy

    Nrc		sN|�d�}|dur.tj|||�||||�d�}|�|�t�j|||d�dS)N�https)�	use_https�timeout�proxy)�verbose)�
startswithrZRequestsTransport�
get_proxy_uri�_reset_host_handler_and_type�super�__init__)	�self�uriZ	transportrr�username�passwordrr��	__class__rrr7s
�
zServer.__init__cCs�|durdStd|�}d}|dur(|}|r@|dur@|d|}|rZ|j|d|jd�}|rl|jdd�}n|jdd�}t|�S)Nzhttp://�:�@)�netlocr)�scheme�http)r�_replacer r)rZ
proxy_hostZ
proxy_userZ
proxy_passr�partsZauth_stringrrrrGszServer.get_proxy_uricCsxt|�\}}|durtd��t|�dks8|dd�dkr<t�|��|_|jdvrXtd��t|�\|_|_|jstd	|_dS)
z�
        Reset the attributes:
        self._host, self._handler, self._type
        according the value of self._uri.

        Kept for backwards compatibility.
        Nzmissing protocol in uri�r�z//)r"rzunsupported XML-RPC protocolz/RPC2)	rr�len�lowerZ_type�IOErrorrZ_hostZ_handler)rr�typerrrr^s	

z#Server._reset_host_handler_and_typecCs|j�||�S�N)�_ServerProxy__transport�
set_header�r�name�argrrrr-uszServer.set_headercCs|j�||�Sr+)r,�
add_headerr.rrrr1xszServer.add_headercCs
|j��Sr+)r,�
clear_headers)rrrrr2{szServer.clear_headerscCs|j�|�dSr+)r,�set_trusted_cert)rZcertfilerrrr3~szServer.set_trusted_cert)NrNNNN)rr	r
�__doc__rrrr-r1r2r3�
__classcell__rrrrr
$s�r
cCs>ddl}t||j�s*||vr&||gSgSdd�|�|�D�S)NrcSs g|]}|�dd�d���qS)r�)�split�strip)�.0�xrrr�
<listcomp>��z#getHeaderValues.<locals>.<listcomp>)�	mimetools�
isinstanceZMessageZgetallmatchingheaders)�headersr/r=rrr�getHeaderValues�s
�r@cCsbd}d}d}||vr t||�}d}||vrZt||�}|rZd�|�}ddl}d|�|�}||fS)z% Reports the error from the headers. r�zX-RHN-Fault-CodezX-RHN-Fault-StringNz%s)�intr@�join�base64Zdecodestring)r?Zerrcode�errmsg�sZ_sListZ_srDrrr�reportError�s

rG)�__version__Z
xmlrpc.clientZclientZ	xmlrpclib�urllib.parserrrrZrhnrr)rZServerProxyr
r@rGrrrr�<module>s^