관리-도구
편집 파일: spacewalk.cpython-36.opt-1.pyc
3 %T�f�6 � @ sf d dl mZ d dl mZ d dlmZmZ d dlZd dlZd dlZd dl Z d dl Z d dlZd dlmZ d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlmZ d Zed �Zed�Zed�Zed �Zed�Zed�Zed�Zed�Zed�Z ed�Z!ed�Z"ed�Z#ed�Z$G dd� dej%�Z&G dd� dej'j(�Z)dd� Z*G dd� de+�Z,dd � Z-d!d"� Z.dS )#� )�absolute_import)�unicode_literals)�_�loggerN)�copy)�PRIO_PLUGINCONFIG)�ustr)� up2dateErrorsz_spacewalk.jsonz7CloudLinux Network based repositories will be disabled.z4CloudLinux Network channel support will be disabled.z@There was an error communicating with CloudLinux Network server.z=This system is not registered with CloudLinux Network server.z.This system is not subscribed to any channels.zSystemId could not be acquired.z%You can use rhn_register to register.z@This system is receiving updates from CloudLinux Network server.z�For security reasons packages from CloudLinux Network based repositories can be verified only with locally installed gpg keys. GPG key '%s' has been rejected.z.Package profile information could not be sent.z=Missing required login information for CloudLinux Network: %sz'Leapp upgrade is running - using cache.z>Spacewalk plugin has to be run under with the root privileges.c sZ e Zd ZdZ� fdd�Zdd� Zdd� Zdd d �Zdd� Zd d� Z dd� Z dd� Z� ZS )� SpacewalkZ spacewalkc s� t t| �j||� || _|| _tjj| jjj t �| _d| _i | _ t| jj�| _| j| j�| _d| jj� kr�| jjd�}x |D ]\}}| jj||t� q|W tjj� s�tjt� d| j_| jjs�d S tjd� | j� d S )NF�mainzinitialized Spacewalk plugin)�superr �__init__�base�cli�os�path�join�confZ persistdir�STORED_CHANNELS_NAME�stored_channels_path�connected_to_spacewalk�up2date_cfgr Zread_config�parser�sections�items� _set_valuer �dnf�utilZ am_i_rootr �warning�MUST_BE_ROOT�enabled�debug�activate_channels)�selfr r �options�key�value)� __class__� �/usr/lib/python3.6/spacewalk.pyr ; s( zSpacewalk.__init__c C s | j jsd S d| jj_d S )NT)r r r ZdemandsZ root_user)r# r( r( r) �configR s zSpacewalk.configc C s t jd� d S )Nz$/usr/sbin/clnreg_ks --strict-edition)r �system)r# r( r( r) �clnregW s zSpacewalk.clnregTc C s� i }d }d}d }d }| j � }|s(|}�n�tjjd�rFtjt� |}�n�tjj � | _ t| j �}| j d f}d}xl|s�ytjj | jjd�}d}W qn tjk r� } z*|dkr�| j� d}wntjdtt| � d S d } ~ X qnX qnW |� s�tjdtt� | ji � d S ytjj| jjd�} W n� tjk �rF } ztjdtt| � d S d } ~ X nX tjk �rt tjdtt� | ji � d S tjk �r� tjd ttt t� d S X d| _!tj"t#� x,| D ]$}|d �r�t$|j%� �||d <