File: //lib/python3.9/site-packages/up2date_client/__pycache__/config.cpython-39.pyc
a
c8h�9 � @ sf d Z ddlZddlZddlZddlZddlmZmZ ddlm Z m
Z
zddlmZm
Z
W n" eyz ddlmZm
Z
Y n0 ddlZejddd�Zeed �s�eje_ejZd
ddd
dddddddddddg d�fd�Zg d�ZG dd� d�ZG dd� d�Zd d!� Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd:d+d,�Zd;d-d.�Z d<d/d0�Z!d1d2� Z"d3d4� Z#d5d6� Z$d=d8d9�Z%dS )>zj
This module includes the Config and Up2date Config classes use by the
up2date agent to hold config info.
� N)�idn_ascii_to_puny�idn_puny_to_unicode)�ustr�sstr)�urlsplit�
urlunsplitzrhn-client-toolsT)�fallback�ugettext)zUse a HTTP Proxyr )zRemote server URLz)https://xmlrpc.cln.cloudlinux.com/XMLRPC/)z&Remote server URL for access over IPv6z.https://ipv6.xmlrpc.cln.cloudlinux.com/XMLRPC/)zMirror list URL�>https://repo.cloudlinux.com/cloudlinux/mirrorlists/cln-mirrors)z#Whether or not debugging is enabledr )zLocation of system idz/etc/sysconfig/rhn/systemid)z4Override the automatically determined system version� )z;HTTP proxy in host:port format, e.g. squid.example.com:3128r )z'The username for an authenticated proxyr )z.The password to use for an authenticated proxyr )z$To use an authenticated proxy or notr )zBNumber of attempts to make at network connections before giving up� )z)The CA cert used to verify the ssl serverz'/usr/share/rhn/CLN-ORG-TRUSTED-SSL-CERT)zDisable the reboot actionr zDConfig options that can not be overwritten by a config update action)� sslCACert� serverURL�disallowConfChanges�noReboot)ZenableProxyr �
serverURLipv6� mirrorURL�debug�systemIdPathZversionOverride� httpProxy� proxyUser�
proxyPasswordZenableProxyAuthZnetworkRetriesr
r r )r r
ZtmpDirc @ sl e Zd ZdZddd�Zddd�Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dd� ZdS )�
ConfigFilez;class for handling persistent config options for the clientNc C s i | _ || _| jr| �� d S �N)�dict�fileName�load��self�filename� r �9/usr/lib/python3.9/site-packages/up2date_client/config.py�__init__C s zConfigFile.__init__c C s� |r
|| _ | j d u rd S t�| j tj�s,d S t| j d�}d}|�� D �]�}|�d�dkrZqD||�� }|slqD|d dkr�|d d� �� }qDnd}|�dd�}t |�d kr�qD|d �� }t
|d �� �}d }|�d
�} | dkr�|d | � }|}d }|�rr|�d�}
|dv �rt|�t
�� ��}nTt |
�dk�rPzt|�}W n t�yL Y n0 n"|
d dk�rdg }nd
d� |
D �}||f}|| jv �r�| j| }|d u�r�||d f}|d u�r�|d |f}|| j|<