HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/uaclient/cli/__pycache__/config.cpython-38.pyc
U

��Jh�*�@s�ddlmZmZmZmZmZmZmZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZddlmZddlmZddlmZdd	lmZdd
lmZmZddlmZmZe� �Z!dd
�Z"dd�Z#e
j$dd��Z%e
j$dd��Z&edej'ej'e#eedej(dd�gd�gd�Z)edej*ej*e%eedej+j,d�-ej.�d�d�gd�gd�Z/edej0ej0e&eedej1j,d�-ej.�d�dd �gd�gd�Z2ed!ej3ej4e"ej5e)e/e2gd"�Z6d#S)$�)�apt_news�config�entitlements�event_logger�
exceptions�http�messages)�_is_attached)�
AptProxyScope)�cli_util)�ProArgument�ProArgumentGroup�
ProCommand)�HelpCategory)�ApplicationStatus)�state_files)�LXDGuestAttachEnum)�configure_livepatch_proxy�unconfigure_livepatch_proxy)�configure_snap_proxy�unconfigure_snap_proxycKsddlm}|��d�dS)Nr��
get_parserr)�uaclient.clir�print_help_for_command)�args�cfg�kwargsr�r�5/usr/lib/python3/dist-packages/uaclient/cli/config.py�
action_configsr cKs�|jrR|jtjkr0tjd�|j�d�tj�d��tdj|jt||jd�d��dSt	t
dd	�tjD��d
�}d|d}tjD]}t|j|t||d�d��q�|js�|jr�|j
s�|jr�ttj�dS)
z�Perform the 'config show' action optionally limit output to a single key

    :return: 0 on success
    :raise UbuntuProError: on invalid keys
    z'{}'�, ��arg�choicesz
{key} {value}N��key�valuercSsg|]}t|��qSr)�len)�.0�xrrr�
<listcomp>6sz&action_config_show.<locals>.<listcomp>�z{key: <z	} {value})r&r�UA_CONFIGURABLE_KEYSr�InvalidArgChoice�format�join�print�getattr�str�max�global_apt_http_proxy�global_apt_https_proxy�ua_apt_http_proxy�ua_apt_https_proxyrZCLI_CONFIG_GLOBAL_XOR_UA_PROXY)rrrZ	col_widthZrow_tmplr&rrr�action_config_show#s.

���
��r9c
Ks�ddlm}|�}z|j�d�\}}Wn.tk
rT|�d�tjd|jd��YnX|tj	kr�|�d�tj
dd�tj	�d	��|��s�|�d�tj
|d
��tt||d��tkr�|��dkr�tj
d
dd	��|��dk}|dk�rZ|�d�d}|dk�rtj}ntj}t�|||�||i}tf|�tj�|�}	|	��\}
}|
tjk�r~tf|��n$||jk�r�|�d�d}|dk�r�tj}ntj }t�|||�t|j!�p�|j"�}|�r�t#t$j%j&ddd��t'�(|t)j*||�d|_!d|_"�n�||j+|j,k�r�d|k�rdnd}|dk�rtj}ntj }||j+k�rXt#t$j-j&d�&|�d�&|�d��d|}t�|||�t|j.�pt|j/�}|�r�t#t$j%j&ddd��t'�(|t)j0||�d|_.d|_/n�|dk�rz$t1|�}|dk�r�td�&|���Wn6tk
�r|�d�t#d�tj2||d��YnXnd|d k�rB|�r6t3�4|�n
t5j6�7�n<|d!k�r~t8|�j9�s`t�:��t5j;�<t5j=t>�?|���d"��t@|||�dS)#zMPerform the 'config set' action.

    @return: 0 on success, 1 otherwise
    rr�=z
config setz
<key>=<value>)ZexpectedZactual�<key>r!r")r#N)�trueZfalsez<value>ztrue, falser<�Z
http_proxyZhttps_proxy�_r�zpro scoped aptz
global apt)Z
current_proxyZprevious_proxy�https�apt_{}_proxy�global_apt_{}_proxy��old�new�global_)Zupdate_messaging_timerZmetering_timerzInvalid interval for {}�r%r�lxd_guest_attach�Zguest_attach)Arr�key_value_pair�split�
ValueErrorrrZGenericInvalidFormatrr-r.r0�stripZEmptyConfigValue�typer2�bool�lowerrZPROXY_VALIDATION_SNAP_HTTP_URLZPROXY_VALIDATION_SNAP_HTTPS_URLZvalidate_proxyrr�	livepatch�LivepatchEntitlement�application_statusr�ENABLEDr�ua_scoped_proxy_optionsZPROXY_VALIDATION_APT_HTTP_URLZPROXY_VALIDATION_APT_HTTPS_URLr5r6r1rZWARNING_APT_PROXY_OVERWRITEr/r�configure_apt_proxyr
�UACLIENT�&deprecated_global_scoped_proxy_options�global_scoped_proxy_options�WARNING_CONFIG_FIELD_RENAMEr7r8�GLOBAL�intZInvalidPosIntConfigValuerZupdate_apt_newsrZapt_news_contents_file�deleter	Zis_attachedZUnattachedError�lxd_pro_config_file�write�LXDProConfigrZ
from_value�setattr)
rrrr�parserZset_keyZ	set_value�
protocol_typeZvalidate_url�entitlement�livepatch_statusr>Z
unset_currentrrr�action_config_setBs�
�


�
�



����
��
�����


�

��rfc	Ks^ddlm}|jtjkr>|�}|�d�tjdd�tj�d��|jdkr�|j�	d�d}t
|d	�tj�
|�}|��\}}|tjkr�t|d	�n�|j|jkr�t�|tj|jd
�n�|j|j|jk�r*|j|jk�rd|jkr�dnd}t�tjjd
�|�d�|�d��d|j|_t�|tj|jd
�n"|jdk�rLtj �!tj"t#j$d��t%||jd
�dS)zOPerform the 'config unset' action.

    @return: 0 on success, 1 otherwise
    rrzconfig unsetr;r!r"r=r>)rcNr@rrArBrCrFrHrI)&rrr&rr-rrr.r0rKrrrQrRrSrrTrrUrrVr
rWrXrY�event�inforrZr/r[rr^r_r`rZOFFra)	rrrrrbrcrdrer>rrr�action_config_unset�sV

�


������riZshowr&�?)�help�nargs)Z	arguments)rk�description�actionZargument_groups�setrJr!)Zoptions)rkZunset)rk�metavarr)rkrmrnZ
help_categoryZsubcommandsN)7ZuaclientrrrrrrrZ(uaclient.api.u.pro.status.is_attached.v1r	Zuaclient.aptr
rrZuaclient.cli.commandsrr
rZuaclient.cli.parserrZ(uaclient.entitlements.entitlement_statusrZuaclient.filesrZuaclient.files.user_config_filerZuaclient.livepatchrrZ
uaclient.snaprrZget_event_loggerrgr r9Zassert_rootrfriZCLI_CONFIG_SHOW_DESCZCLI_CONFIG_SHOW_KEYZshow_subcommandZCLI_CONFIG_SET_DESCZCLI_CONFIG_SET_KEY_VALUEr/r0r-Zset_subcommandZCLI_CONFIG_UNSET_DESCZCLI_CONFIG_UNSET_KEYZunset_subcommandZCLI_ROOT_CONFIGZCLI_CONFIG_DESCZOTHERZconfig_commandrrrr�<module>s�$	

0�����
������
�������