HEX
Server: LiteSpeed
System: Linux w5304130.sdnsbox.com 4.18.0-425.3.1.lve.el8.x86_64 #1 SMP Tue Nov 22 22:59:23 EST 2022 x86_64
User: makefitmeserver (1001)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //usr/lib/python3.6/site-packages/up2date_client/__pycache__/rhncli.cpython-36.pyc
3

U��Zz!�@sfddlZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZyddl
Z
Wnek
r�ddljZ
YnXddlZejdd	d
�Zeed�s�eje_ejZddlmZdd
lmZddlmZddlmZddlmZddlmZedddded�d�edded�d�edded�d�edded�d�gZGdd �d e�Z d!d"�Z!dS)#�N)�Option)�OptionParser)�SSL)�crypto)�rpclib)�sstrzrhn-client-toolsT)Zfallback�ugettext)�config)�up2dateAuth)�
up2dateErrors)�
up2dateLog)�up2dateUtils)�pkgUtilsz-vz	--verbose�countzShow additional output)�action�default�helpz--proxyZstorezSpecify 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 proxyc@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zedd��Z
edd��ZdS)�RhnClicCs(tttj�d�|_d|_d|_d|_dS)N)Zoption_list�versionF)r�
_optionsTabler�_RhnCli__versionString�	optparser�options�args�hasGui)�self�r�/usr/lib/python3.6/rhncli.py�__init__Os
zRhnCli.__init__cCs�tt_y |j�tj|j�pd�W�n�tk
rZtjjt	t
d���tjd�Y�n�tk
r�tjjt	t
d�tj�d��tjd�Y�nRt
jk
�rtj�d}|dks�tt|��dkr�tjjt	t
d���ntjjt	t
d�|��Y�n�tk
�rBtjjt	t
d�tj�d��tjd�Y�n�tjk
�r�tjjt	t
d�tj�d��tjjt	t
d	���tjd�Y�nRtjtjfk
�r�tjjt	d
ttj�d���tjd�Y�n
tjk
�rtjjt	t
d�tj�d��Yn�tk
�r,�Yn�tjk
�rltjjt	t
d
�tj�d��tjd�Yn~tjk
�r�tjjt	dtj�d��tjd�YnBtjk
�r�tjjt	dttj�d���tjd�YnXdS)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�errr�runXsL    $  z
RhnCli.runcCs^|jj�\|_|_tj|jj�tj�dkrRt	d�t
jd}|j|�t
j
d�|j�dS)NrzYou must be root to run %sr)r�
parse_argsrrr�_RhnCli__setDebugLevel�verbose�os�geteuidr+r#�argv�_warning_dialogr&�_RhnCli__updateProxyConfig)rZrootWarningMsgrrrr%�s

zRhnCli.initializecCst�dS)N)�NotImplementedError)rrrrr'�szRhnCli.maincCs�ytj�dStjk
r2ttj�d�dStjk
rFdStjk
rzt	j
�}|jd�|jtj��dSXdS)NTrFz4There was a RhnServerException while testing login:
)
r
ZupdateLoginInforZServerCapabilityError�printr#r-r5ZRhnServerExceptionr�initLogZlog_me�
log_exception)r�logrrr�
_testRhnLogin�s
zRhnCli._testRhnLoginc	CsP|jrDyddlm}|j|�WqLttd��t|�YqLXnt|�dS)Nr)�guiz'Unable to open gui. Try `up2date --nox`)r�up2date_clientrG�errorWindowrBr+)r�messagerGrrrr?�szRhnCli._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�setrKrL)r�cfgrrrZ__updateProxyConfig�szRhnCli.__updateProxyConfigcCstj�}|j�dS)zM
        Saves the current up2date configuration being used to disk.
        N)r	rMZsave)rrPrrr�
saveConfig�szRhnCli.saveConfigc	CsP|jrDyddlm}|j|�WqLttd��t|�YqLXnt|�dS)Nr)rGz'Unable to open gui. Try `up2date --nox`)rrHrGrIrBr+)rZerrMsgrGrrrZ__faultError�szRhnCli.__faultErrorcCstd�tj�}|S)Nzp%%prog (Spacewalk Client Tools) %s
Copyright (C) 1999--2014 Red Hat, Inc.
Licensed under the terms of the GPLv2.)r+r
r)Z
versionStringrrrZ__versionString�s
zRhnCli.__versionStringcCs0tj�}|d||d<|ddkr,tj�dS)N�debugr )r	rMrZsetDebugVerbosity)�levelrPrrrZ__setDebugLevel�szRhnCli.__setDebugLevelN)�__name__�
__module__�__qualname__rr8r%r'rFr?r@rQZ_RhnCli__faultError�staticmethodrr:rrrrrMs	,
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rCr#r)r*rr+�hasattrrYrDr/)�type�value�tbrErrrr"�s
r")"r#r<r2ZoptparserrZOpenSSLrrZrhnrZrhn.i18nrr6�ImportErrorZ
xmlrpc.clientZclient�gettextZtranslation�trZrr+rHr	r
rrr
rr�objectrr"rrrr�<module>"sD