관리-도구
편집 파일: up2dateAuth.cpython-36.pyc
3 e�$g+% � @ s< d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ yd dlm Z W n e k rd eZ Y nX d dlm Z d dlmZ d dlmZ d dlmZ d dlmZ d d lmZ d d lmZ dadZdd � Zdd� Zdd� Zdd� Zdd� Zd'dd�Zd(dd�Zd)dd�ZG dd� de�Zdd � Z d!d"� Z!d#d$� Z"d%d&� Z#dS )*� N)� rpcServer)�DictType)�rpclib)� clientCaps)�config)� rhnserver)� up2dateErrors)� up2dateLog)�up2dateUtilsz /var/spool/up2date/loginAuth.pklc C s@ t j� } | d }tj|tj�s"d S t|d�}|j� }|j� |S )N�systemIdPath�r)r �initUp2dateConfig�os�access�R_OK�open�read�close)�cfg�path�f�ret� r �!/usr/lib/python3.6/up2dateAuth.py�getSystemId s r c C s& t j� } ytjjt� �d d d }W n dS tj� }||k�r"tj � }|j jt� |�}| d }|d |jd�� }t j|t j�s�yt j|� W n dS t j|t j�s�dS t j|t j�r�|d }yt j||� W n dS t|d�}|j|� |j� yt j|tdd�� W n Y nX d S ) Nr Z os_releaser �/z.save�w�0600� )r r r � xmlrpclib�loadsr r Z getVersionr � RhnServerZregistrationZupgrade_version�rfindr r �W_OK�mkdir�F_OK�renamer �writer �chmod�int) r �idVerZ systemVer�sZnewSystemIdr �dirZsavePathr r r r �maybeUpdateVersion* s>