????
| Current Path : /proc/1724857/root/lib/python3.9/site-packages/rhn/__pycache__/ |
| Current File : //proc/1724857/root/lib/python3.9/site-packages/rhn/__pycache__/rpclib.cpython-39.opt-1.pyc |
a
Z�iQ � @ sj d Z ddlmZ ddlmZmZmZmZ ddl m
Z
G dd� de�ZG dd� dej
�Zd d
� Zdd� ZdS )
z3.0.3-1.el9.cloudlinux-� N)�urlparse�
urlunparse� splittype� splithost)�
transportsc @ s e Zd ZdS )�MalformedURIErrorN)�__name__�
__module__�__qualname__� r r �./usr/lib/python3.9/site-packages/rhn/rpclib.pyr s r c sR e Zd ZdZd� fdd� Zdd� Zdd � Zd
d� Zdd
� 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
Nr c sN |� d�}|d u r.tj||| �||||�d�}| �|� t� j|||d� d S )N�https)� use_https�timeout�proxy)�verbose)�
startswithr ZRequestsTransport�
get_proxy_uri�_reset_host_handler_and_type�super�__init__) �self�uriZ transportr r �username�passwordr r �� __class__r r r 7 s
�
zServer.__init__c C s� |d u rd S t d| �}d }|d ur(|}|r@|d ur@|d | }|rZ|j|d |j d�}|rl|jdd�}n|jdd�}t|�S )Nzhttp://�:�@)�netlocr )�scheme�http)r �_replacer r )r Z
proxy_hostZ
proxy_userZ
proxy_passr �partsZauth_stringr r r r G s zServer.get_proxy_uric C sx t |�\}}|du rtd��t|�dk s8|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"