Yohohohohohooho | Sanrei Aya
Sanrei Aya


Server : LiteSpeed
System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : elvh3918 ( 1528)
PHP Version : 8.2.31
Disable Function : mail
Directory :  /proc/self/root/usr/lib/python3.9/site-packages/up2date_client/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python3.9/site-packages/up2date_client/__pycache__/config.cpython-39.pyc
a

/V)j7�@s<dZddlZddlZddlZddlZddlmZmZddlm	Z	m
Z
zddlmZm
Z
Wn"eyzddlmZm
Z
Yn0ddlZejddd�Zeed	�s�eje_ejZd
ddd
ddddddddddgd�fd�Zgd�ZGdd�d�ZGdd�d�Zdd �Zd!d"�Zd#d$�Zd/d&d'�Zd0d(d)�Zd1d*d+�Zd2d-d.�Z dS)3zj
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 URLz>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-CERTzDConfig options that can not be overwritten by a config update action)�	sslCACert�	serverURL�disallowConfChanges)ZenableProxyr
�
serverURLipv6Z	mirrorURL�debug�systemIdPathZversionOverride�	httpProxy�	proxyUser�
proxyPasswordZenableProxyAuthZnetworkRetriesrr)rrZtmpDirc@sleZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
ConfigFilez;class for handling persistent config options for the clientNcCsi|_||_|jr|��dS�N)�dict�fileName�load��self�filename�r�9/usr/lib/python3.9/site-packages/up2date_client/config.py�__init__BszConfigFile.__init__c	Cs�|r
||_|jdurdSt�|jtj�s,dSt|jd�}d}|��D�]�}|�d�dkrZqD||��}|slqD|ddkr�|dd���}qDnd}|�dd�}t	|�d	kr�qD|d��}t
|d���}d}|�d
�}	|	dkr�|d|	�}|}d}|�rr|�d�}
|dv�rt|�t
����}nTt	|
�dk�rPzt|�}Wnt�yLYn0n"|
ddk�rdg}nd
d�|
D�}||f}||jv�r�|j|}|du�r�||df}|du�r�|d|f}||j|<qD|��dS)N�rr
�#r����\�=r�z	[comment]�;)rrcSsg|]}|��r|���qSr)�strip)�.0�valrrr�
<listcomp>��z#ConfigFile.load.<locals>.<listcomp>)r�os�access�R_OK�open�	readlines�findr'�split�lenrr�encode�locale�getpreferredencoding�int�
ValueErrorr�close)rr�fZ	multiline�liner2�key�value�comment�pos�valuesZnewvalrrrrHsd






zConfigFile.loadcCs�|jdurdSt�|jtj�sTt�tj�|j�tj�sTttdtj�|j���dSt�|jdtj	tj
BtjBtjBtj
Bd�}zt�|d�t�|d�}Wnty�t�|��Yn0|�d�|�d�|�d�|j��D]�}|j|\}}|�td||f��t|�tg�k�r&|g}|tv�r>ttjj|�}|�td	|d
�tt|��f��|�d�q�|��t�|jd|j�dS)Nz%s was not foundz.newi��wzI# Automatically generated Red Hat Update Agent config file, do not edit.
z# Format: 1.0
r
z%s[comment]=%s
z%s=%s
r&�
)rr,r-r.�path�dirname�print�_r/�O_WRONLY�O_CREAT�O_TRUNC�
O_NOFOLLOW�	O_CLOEXEC�fchmod�fdopen�	Exceptionr9�writer�keysr�type�FileOptions�map�abspath�join�str�rename)r�fdr:r<r>r=rrr�save�s>
	�




"zConfigFile.savecCs
||jvSr�r�r�namerrr�__contains__�szConfigFile.__contains__cCs||vSrrr[rrr�has_key�szConfigFile.has_keycCs
|j��Sr)rrP�rrrrrP�szConfigFile.keyscCsdd�|j��D�S)NcSsg|]}|d�qS)rr)r(�arrrr*�r+z%ConfigFile.values.<locals>.<listcomp>)rr@r_rrrr@�szConfigFile.valuescCs|j�|�dSr)r�update)rrrrrra�szConfigFile.updatecCs||jvr|j|dSdS)NrrZr[rrr�__getitem__�s
zConfigFile.__getitem__cCs0||jvr|j|}nd}|d|f|j|<dS)N)NNrrZ)rr\r=r)rrr�__setitem__�s
zConfigFile.__setitem__cCs||jvr|j|dSdS)Nrr
rZr[rrr�info�s
zConfigFile.info)N)N)�__name__�
__module__�__qualname__�__doc__rrrYr]r^rPr@rarbrcrdrrrrr?s

H0rc@sveZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�ConfigNcCs.t�|_|j�t�|r$|j�|�i|_dSr)r�storedra�Defaultsr�runtimerrrrr�s
zConfig.__init__cCs ||jvrdS||jvrdSdS)NTF�rlrjr[rrrr]�s


zConfig.__contains__cCs||vSrrr[rrrr^�szConfig.has_keycCs4t|j���}|j��D]}||vr|�|�q|Sr)�listrlrPrj�append�r�ret�krrrrP�s
zConfig.keyscCs&g}|��D]}|�|�|��q|Sr�rProrbrprrrr@sz
Config.valuescCs*g}|��D]}|�||�|�f�q|Srrsrprrr�items	szConfig.itemscCst|���Sr)r3rPr_rrr�__len__szConfig.__len__cCs||j|<dSr)rl�rr\r=rrrrcszConfig.__setitem__cCs,||jvr|j|S||jvr(|j|SdSrrmr[rrrrbs




zConfig.__getitem__cCs|j�|�Sr)rjrdr[rrrrdszConfig.infocCs|j��dSr)rjrYr_rrrrY"szConfig.savecCs4|j�|�|j��D]}||jvr&q|j|=qdSr)rjrrPrl)rrrrrrrr%s

zConfig.loadcCs ||j|<||jvr|j|=dSr)rjrlrvrrr�set/s

z
Config.set)N)rerfrgrr]r^rPr@rtrurcrbrdrYrrwrrrrri�s
		
ricCs^t�}d}|d}|rZ|dd�dkr2|dd�}|�d�}tt|d��|d<d�|�}|S)zkreturns proxy string in format hostname:port
    hostname is converted to Punycode (RFC3492) if needed
    Nr�zhttp://�:r)�initUp2dateConfigr2rVrrU)�cfg�proxyZ	proxyHost�partsrrr�getProxySetting6s

r~cCs:t|�}tt|dtt|d��|d|d|df��S)z=returns url where hostname is converted to Punycode (RFC3492)rrr%��)rrrrr)�url�srrr�convert_url_to_punyHsr�cCs&t|t�rdd�|D�St|�gSdS)z�
    Internal function to process server URL to Punycode format.

    Processes both single URLs and lists of URLs.

    :param serverUrl: URL or list of URLs to process.
    :return: List of processed URLs in Punycode format.
    cSsg|]}t|��qSr)r�)r(�irrrr*Xr+z$processServerURL.<locals>.<listcomp>N)�
isinstancernr�)Z	serverUrlrrr�processServerURLNs	
r�FcCs^t�}t|d�}t|d�}||f}||f}|r6|Sddlm}|��}|dkrZ|rZ|S|S)a�
    Return a pair of server URLs (primary and fallback) based on the preferred interface.

    :param registration: If True, it indicates that the URLs are being fetched for registration purposes.
    If that is the case, the function will always use IPv4 URLs with IPv6 as fallback,
    regardless of the preferred_interface setting.
    Assumed false by default, expected to be specified explicitly when needed.

    :return: Pair of server URL configs, first is the primary, second is the fallback.
    r
rr)�up2dateAuthZIPv6)rzr�Zup2date_clientr�ZgetPreferredInterface)�registrationr{Zipv4_urlZipv6_urlZipv4_primary_pairZipv6_primary_pairr�Zpreferred_interfacerrr�getServerURLPair]sr�cCst|d�dS)az
    Return the primary server URL from config based on preferred_interface.

    If preferred_interface=IPv6 in system_id, returns serverURLipv6 if available.
    Otherwise returns normal serverURL.
    Note: the config may have one value or a list of values, but this function always returns a list.

    :return: List of server URLs with hostnames converted to Punycode.
    �r�r�r�r�rrr�getServerURL�s
r�cCst|d�dS)z�
    Determine the fallback server URL from system_id.

    The fallback server URL is the one that is *not* set as preferred_interface.
    If preferred_interface is IPv6, it returns serverURL (i.e. IPv4 host), otherwise serverURLipv6.
    r�rr�r�rrr�getFallbackServerURL�sr��/etc/sysconfig/rhn/up2datecCsNztWntydaYn0tdkrJt|�adtd<tj��rJdtd<tS)z<This function is the right way to get at the up2date config.NF�isattyT)r{�	NameErrorri�sys�stdoutr�)Zcfg_filerrrrz�s

rz)F)F)F)r�)!rhr,r�r5ZrequestsZrhn.connectionsrrZrhn.i18nrr�urlparserr�ImportError�urllib.parse�gettext�translation�t�hasattrr	rFrkrRrrir~r�r�r�r�r�rzrrrr�<module>sV
��)O
'



Yohohohohohooho | Sanrei Aya