관리-도구
편집 파일: rhncli.cpython-36.pyc
3 e�$gw$ � @ sv d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZ d dl m Z d dlmZ yd dl Z W n ek r� d dljZ Y nX d dlZejdd d �Zeed�s�eje_ejZd dlmZ d d lmZ d dlmZ d dlmZ d dlmZ d dlmZ edddd ed�d�edded�d�edded�d�edded�d�edd ed!�d�gZG d"d#� 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)r r z--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 @ st e Zd Zdd� Zdd� Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zdd� Ze dd� �Ze dd� �ZdS )�RhnClic C s( t ttj� d�| _d | _d | _d| _d S )N)Zoption_list�versionF)r � _optionsTabler �_RhnCli__versionString� optparser�options�args�hasGui)�self� r �/usr/lib/python3.6/rhncli.py�__init__Q s zRhnCli.__init__c C s� t t_y | j� tj| j� pd� W �n� tk rZ tjjt t d��� tjd� Y �n� tk r� tjjt t d�tj� d �� tjd� Y �nR t jk �r tj� d }|d ks�tt|��dkr�tjjt t d��� ntjjt t d�| �� Y �n� tk �rB tjjt t d�tj� d �� tjd� Y �n� tjk �r� tjjt t d�tj� d �� tjjt t d ��� tjd� Y �nR tjtjfk �r� tjjt d ttj� d � �� tjd� Y �n tjk �r tjjt t d�tj� d �� Y n� tk �r, � Y n� tjk �rl tjjt t d �tj� d �� tjd� Y n~ tjk �r� tjjt dtj� d �� tjd� Y nB tjk �r� tjjt dttj� d � �� tjd� Y nX d S )Nr z 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_infor ZMalformedURIError�len�str�IOErrorr �ErrorZSysCallError�socket�errorr � SystemExitr �AuthenticationErrorZRpmError� xmlrpclibZ ProtocolError)r �er r r �runZ sL $ z RhnCli.runc C sn | j j� \| _| _tj| jj� tj� dkrRt d�t jd }| j|� t j d� | jjrb| j� | j� d S )Nr zYou must be root to run %sr )r � parse_argsr r r �_RhnCli__setDebugLevel�verbose�os�geteuidr, r$ �argv�_warning_dialogr'