관리-도구
편집 파일: rhnreg.cpython-36.pyc
3 e�$g� � @ s� d dl Z d dlZd dlZd dlZd dlZd dlmZmZ d dlmZ d dlm Z d dlm Z d dlmZ d dlmZ d dlm Z d d lmZ d d lmZ d dlmZ d dlmZmZ d d lmZ y4d dlZd dlZd dlmZmZmZmZmZm Z W nF e!k �r: d dl"j#Zd dl$j%Ze&Ze'Ze(Ze)Ze*Ze*Z e+Z,Y nX yd dl-m.Z. W n e!k �rf dZ.Y nX d dl/Z/e/j0ddd�Z1e2e1d��s�e1j/e1_3e1j3Z4dZ5de5 Z6de5 Z7dZ8dZ9dZ:dZ;dZ<ddddd �Z=d!d"� e=j>� D �Z?d d#lm@Z@ e@jA� ZBejC� ZDd$d%� ZEd&d'� ZFd(d)� ZGd*d+� ZHd,d-� ZId.d/� ZJd0d1� ZKd2d3� ZLd4d5� ZMe)eNd6�d7d8�ZOeNd9�d:d;�ZPd�d=d>�ZQd?d@� ZRdAdB� ZSdCdD� ZTdEdF� ZUdGdH� ZVdIdJ� ZWdKdL� ZXdMdN� ZYdOdP� ZZG dQdR� dR�Z[d�eNdS�dTdU�Z\dVdW� Z]dXdY� Z^dZd[� Z_d\d]� Z`e)d^�d_d`�Zad�dadb�Zbdcdd� Zcdedf� Zddgdh� Zedddddi fdidj�Zfdkdl� Zgdmdn� Zhdodp� Zidqdr� Zjdsdt� Zkdudv� Zld�dwdx�ZmG dydz� dz�Znd{d|� Zod}d~� Zpd�dd��Zqd�d�� Zre� d�k�r�d�d�� Zsnd d�ltmsZs dS )�� N)�up2dateUtils�cldetect)� up2dateErrors)�up2dateAuth)� rhnserver)�pkgUtils)� up2dateLog)�rhnreg_constants)�hardware)�convertPackagesFromHashToList)�getPlatform)�ustr�sstr)� raise_with_tb)�ListType� TupleType� StringType�UnicodeType�DictType�DictionaryType)�supportzrhn-client-toolsT)Zfallback�ugettextz/etc/sysconfig/rhnz%s/rhn_register_remindz%s/hw-activation-codez/etc/pki/consumer/cert.pemz$/etc/sysconfig/rhn/cl-rollout-ca.pemz!/etc/sysconfig/rhn/cl-rollout.pemz%/etc/sysconfig/rhn/cl-rollout-key.pemz/etc/sysconfig/rhn/jwt.tokenZ shared_pro�shared�solo�admin)zCloudLinux OS Shared ProzCloudLinux OS SharedzCloudLinux OS SolozCloudLinux OS Adminc C s i | ]\}}||�qS � r )�.0�k�vr r �/usr/lib/python3.6/rhnreg.py� <dictcomp>K s r )�configc C s& t jdt jt jB ��r"d} d}t j|t jt jB �sNt jdt jt jB �rNd}d} t jd| t j�r�t j|t jt jB �r�t jd| � t jd| � nttd �� n�t jd t jt jB �r�t jd� nttd�� d }t j|t jt jB ��s t jdt jt jB ��r d}t jd| �}|�r"t jd| � d S )Nz/usr/sbin/rhnsdz/usr/lib/systemd/systemz/usr/bin/systemctlz/bin/systemctlz/lib/systemd/systemz%s/rhnsd.servicez%s enable rhnsd > /dev/nullz%s start rhnsd > /dev/nullz,Warning: unable to enable rhnsd with systemdz/sbin/chkconfigz$/sbin/chkconfig rhnsd on > /dev/nullz.Warning: unable to enable rhnsd with chkconfigz /sbin/servicez/usr/sbin/servicez%s rhnsd status > /dev/nullz%s rhnsd start > /dev/null)�os�access�R_OK�X_OK�system�print�_)Zsystemd_system_unitdirZsystemd_systemctlZservice_pathZrcr r r � startRhnsdS s, r) c C s� t d p d} tj| tj�si S t| d�}|j� }i }x`|D ]X}|j� }|dkrPq:y|jd�\}}W n" tk r� t t j|�� Y nX |j� ||<