HEX
Server: LiteSpeed
System: Linux server384.web-hosting.com 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User: drivkxoj (2377)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/up2date_client/__pycache__/rhncli.cpython-36.pyc
3

m��i��@sRddlZddlZddlmZddlmZddlZddlmZddl	m
Z
yddlZWnek
rrddl
jZYnXddlZejddd�Zeed	�s�eje_ejZdd
lmZddlmZddlmZdd
lmZddlmZedddded�d�edded�d�edded�d�edded�d�edded�d�gZGdd �d e�Zd!d"�ZdS)#�N)�Option)�OptionParser)�rpclib)�sstrzrhn-client-toolsT)Zfallback�ugettext)�config)�up2dateAuth)�
up2dateErrors)�
up2dateLog)�up2dateUtilsz-vz	--verbose�countzShow additional output)�action�default�helpz--proxyZstorezSpecify an http proxy to use)r
rz--proxyUserz:Specify a username to use with an authenticated http proxyz--proxyPasswordz:Specify a password to use with an authenticated http proxyz--debug�
store_truez&Enable debug output (network requests)c@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
edd��Zedd��Z
dS)�RhnClicCs"tttj�d�|_d|_d|_dS)N)Zoption_list�version)r�
_optionsTabler�_RhnCli__versionString�	optparser�options�args)�self�r�/usr/lib/python3.6/rhncli.py�__init__MszRhnCli.__init__cCsBtt_y |j�tj|j�pd�W�ntk
rZtjjt	t
d���tjd�Y�n�tjj
k
r�}zDtjjt	t
d�tj�d��tjjt	t
d���tjd�WYdd}~X�n�tk
r�tjjt	t
d�tj�d��tjd�Y�nBtjk
�rhtj�d}|dk�s6tt|��dk�rLtjjt	t
d���ntjjt	t
d�|��Yn�tk
�r�tjjt	t
d	�tj�d��tjd�Yn�tk
�r��Yn�tjk
�r�tjjt	t
d
�tj�d��tjd�YnBtjk
�r<tjjt	dttj�d���tjd�YnXdS)
Nrz

Aborted.
�zThere was an SSL error: %s
zqA common cause of this error is the system time being incorrect. Verify that the time on this system is correct.
z$An unexpected OS error occurred: %s
z1A connection was attempted with a malformed URI.
z5A connection was attempted with a malformed URI: %s.
z%There was some sort of I/O error: %s
z&There was an authentication error: %s
zXMLRPC ProtocolError: %s
�)�exceptionHandler�sys�
excepthook�
initialize�exit�main�KeyboardInterrupt�stderr�writer�_�requests�
exceptionsZSSLError�exc_info�OSErrorrZMalformedURIError�len�str�IOError�
SystemExitr	ZAuthenticationError�	xmlrpclibZ
ProtocolError)r�errr�runTs<     z
RhnCli.runcCsn|jj�\|_|_tj|jj�tj�dkrRt	d�t
jd}|j|�t
j
d�|jjrb|j�|j�dS)NrzYou must be root to run %sr)r�
parse_argsrrr�_RhnCli__setDebugLevel�verbose�os�geteuidr'r�argv�_warning_dialogr"�debug�_initialize_debug_network_logs�_RhnCli__updateProxyConfig)rZrootWarningMsgrrrr!xs

zRhnCli.initializecCst�dS)N)�NotImplementedError)rrrrr#�szRhnCli.maincCsxddl}yddlm}Wn tk
r8ddlm}YnXd|_|j�|j�j|j	�|jd�}|j|j	�d|_
dS)zF
        Enables logging of all all https requests to console
        rN)�HTTPConnectionrzrequests.packages.urllib3T)�loggingZhttp.clientr>�ImportErrorZhttplibZ
debuglevelZbasicConfigZ	getLoggerZsetLevel�DEBUGZ	propagate)rr?r>Zrequests_logrrrr;�s
z%RhnCli._initialize_debug_network_logscCst|�dS)N)�print)r�messagerrrr9�szRhnCli._warning_dialogcCsxtj�}|jjr,|jd|jj�|jdd�|jjrP|jd|jj�|jdd�|jjrt|jd|jj�|jdd�dS)z�Update potential proxy configuration.
        Note: this will _not_ save the info to up2date's configuration file
        A separate call to config.initUp2dateConfig.save() is needed.
        Z	httpProxyZenableProxyr�	proxyUserZenableProxyAuth�
proxyPasswordN)r�initUp2dateConfigr�proxy�setrDrE)r�cfgrrrZ__updateProxyConfig�szRhnCli.__updateProxyConfigcCstj�}|j�dS)zM
        Saves the current up2date configuration being used to disk.
        N)rrFZsave)rrIrrr�
saveConfig�szRhnCli.saveConfigcCstd�tj�}|S)Nzp%%prog (Spacewalk Client Tools) %s
Copyright (C) 1999--2014 Red Hat, Inc.
Licensed under the terms of the GPLv2.)r'rr)Z
versionStringrrrZ__versionString�s
zRhnCli.__versionStringcCstj�}|d||d<dS)Nr:)rrF)�levelrIrrrZ__setDebugLevel�szRhnCli.__setDebugLevelN)�__name__�
__module__�__qualname__rr2r!r#r;r9r<rJ�staticmethodrr4rrrrrKs$rcCs�tj�}tjjttd�d��t|d�rPtjjt|j�d�|j	|||�n&tjjtt
|�d��|j	|||�tjjttd�d��dS)NzAn error has occurred:�
�errmsgz)See /var/log/up2date for more information)r
ZinitLogrr%r&rr'�hasattrrQZ
log_exceptionr-)�type�value�tb�logrrrr�s
r)rr6ZoptparserrZrequests.exceptionsr(ZrhnrZrhn.i18nrr0r@Z
xmlrpc.clientZclient�gettextZtranslation�trRrr'Zup2date_clientrrr	r
rr�objectrrrrrr�<module>"s@





z