HEX
Server: Apache
System: Linux a16-asgard6.hospedagemuolhost.com.br 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: maoristu4c3dbd03 (1436)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3.9/site-packages/up2date_client/__pycache__/rhncli.cpython-39.pyc
a

c8hw$�	@svddlZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZzddl
Z
Wney�ddlmZ
Yn0ddlZejdd	d
�Zeed�s�eje_ejZddlmZdd
lmZddlmZddlmZddlmZddlmZedddded�d�edded�d�edded�d�edded�d�edd ed!�d�gZGd"d#�d#e�Z d$d%�Z!dS)&�N)�Option)�OptionParser)�SSL)�crypto)�rpclib)�sstrzrhn-client-toolsT)�fallback�ugettext)�config)�up2dateAuth)�
up2dateErrors)�
up2dateLog)�up2dateUtils)�pkgUtilsz-vz	--verbose�countzShow additional output)�action�default�helpz--proxy�storezSpecify an http proxy to use)rrz--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@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��ZdS)�RhnClicCs(ttt��d�|_d|_d|_d|_dS)N)Zoption_list�versionF)r�
_optionsTabler�_RhnCli__versionString�	optparser�options�args�hasGui��self�r �9/usr/lib/python3.9/site-packages/up2date_client/rhncli.py�__init__Qs�zRhnCli.__init__c
Cs�tt_z |��t�|��pd�W�n�tyXtj�t	t
d���t�d�Y�nzty�tj�t	t
d�t��d��t�d�Y�n>t
jy�t��d}|dus�tt|��dkr�tj�t	t
d���ntj�t	t
d�|��Y�n�t�y8tj�t	t
d�t��d��t�d�Y�n�tj�y�tj�t	t
d�t��d��tj�t	t
d	���t�d�Y�nFtjtjf�y�tj�t	d
tt��d���t�d�Y�ntj�ytj�t	t
d�t��d��Yn�t�y�Yn�tj�yXtj�t	t
d
�t��d��t�d�Ynztj�y�tj�t	dt��d��t�d�Yn@tj�y�tj�t	dtt��d���t�d�Yn0dS)Nrz

Aborted.
�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
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.
zOpenSSL.SSL.SysCallError: %s
�z!There was a SSL crypto error: %s
z&There was an authentication error: %s
z%s
zXMLRPC ProtocolError: %s
�)�exceptionHandler�sys�
excepthook�
initialize�exit�main�KeyboardInterrupt�stderr�writer�_�OSError�exc_inforZMalformedURIError�len�str�IOErrorr�ErrorZSysCallError�socket�errorr�
SystemExitr�AuthenticationErrorZRpmError�	xmlrpclibZ
ProtocolError)r�er r r!�runZsL    $  z
RhnCli.runcCsn|j��\|_|_t�|jj�t��dkrRt	d�t
jd}|�|�t
�
d�|jjrb|��|��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)rZrootWarningMsgr r r!r)�s

zRhnCli.initializecCst�dS)N)�NotImplementedErrorrr r r!r+�szRhnCli.maincCsvddl}zddlm}Wnty6ddlm}Yn0d|_|��|���|j	�|�d�}|�|j	�d|_
dS)zF
        Enables logging of all all https requests to console
        rN)�HTTPConnectionr#zrequests.packages.urllib3T)�loggingZhttp.clientrH�ImportErrorZhttplibZ
debuglevelZbasicConfigZ	getLoggerZsetLevel�DEBUGZ	propagate)rrIrHZrequests_logr r r!rE�s
z%RhnCli._initialize_debug_network_logscCs�zt��WdStjy4tt��d�YdStjyHYdStjy|t	�
�}|�d�|jt���YdS0dS)NTr#Fz4There was a RhnServerException while testing login:
)
rZupdateLoginInforZServerCapabilityError�printr'r1r9ZRhnServerExceptionr
�initLogZlog_me�
log_exception)r�logr r r!�
_testRhnLogin�s
zRhnCli._testRhnLogincCsP|jrDzddlm}|�|�WqLttd��t|�YqL0nt|�dS�Nr)�guiz'Unable to open gui. Try `up2date --nox`�r�up2date_clientrRZerrorWindowrLr/)r�messagerRr r r!rC�szRhnCli._warning_dialogcCsxt��}|jjr,|�d|jj�|�dd�|jjrP|�d|jj�|�dd�|jjrt|�d|jj�|�dd�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�setrVrW�r�cfgr r r!Z__updateProxyConfig�szRhnCli.__updateProxyConfigcCst��}|��dS)zM
        Saves the current up2date configuration being used to disk.
        N)r
rXZsaver[r r r!�
saveConfig�szRhnCli.saveConfigcCsP|jrDzddlm}|�|�WqLttd��t|�YqL0nt|�dSrQrS)rZerrMsgrRr r r!Z__faultError�szRhnCli.__faultErrorcCstd�t��}|S)Nzp%%prog (Spacewalk Client Tools) %s
Copyright (C) 1999--2014 Red Hat, Inc.
Licensed under the terms of the GPLv2.)r/rr)Z
versionStringr r r!Z__versionString�s�zRhnCli.__versionStringcCs0t��}|d||d<|ddkr,t��dS)NrDr$)r
rXrZsetDebugVerbosity)�levelr\r r r!Z__setDebugLevel�szRhnCli.__setDebugLevelN)�__name__�
__module__�__qualname__r"r<r)r+rErPrCrFr]Z_RhnCli__faultError�staticmethodrr>r r r r!rOs	,
rcCs�t��}tj�ttd�d��t|d�rPtj�t|j�d�|�	|||�n&tj�tt
|�d��|�	|||�tj�ttd�d��dS)NzAn error has occurred:�
�errmsgz)See /var/log/up2date for more information)r
rMr'r-r.rr/�hasattrrdrNr3)�type�value�tbrOr r r!r&�s
r&)"r'r@r6ZoptparserrZOpenSSLrrZrhnrZrhn.i18nrr:rJZ
xmlrpc.clientZclient�gettext�translation�trer	r/rTr
rrr
rrr�objectrr&r r r r!�<module>"sT

������
)