| Server IP : 172.67.131.151 / Your IP : 104.23.243.167 Web Server : Apache System : Linux keen-cori.18-142-40-148.plesk.page 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64 User : simottodesign.com_2tntp341vs7 ( 10011) PHP Version : 8.3.31 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/uaclient/__pycache__/ |
Upload File : |
U
2�d� � @ sl d dl Zd dlZd dlZd dlZd dlZd dlmZmZm Z d dl
mZmZm
Z
mZmZmZ dZdddgZdZd Zd
ZdZe�� Ze�e�e��Zedd
efdefdefdefdefg�Zed�dd�Z d+e e e e e ee! dd�dd�Z"d,ee ee! dd�dd�Z#ee e d�dd�Z$ee d�dd�Z%d d!� Z&d"d#� Z'd-ee e ed%�d&d'�Z(eed(�d)d*�Z)dS ).� N)�List�
NamedTuple�Optional)�apt�event_logger�
exceptions�messages�system�utilz
/usr/bin/snapg �?g �?g @z
proxy.httpzproxy.httpsz/run/snapd.socketz/v2/snaps/{}�SnapPackage�name�version�revision�channel� publisher)�returnc C s dt �� kS )z(Returns whether or not snap is installed�snapd)r Zget_installed_packages_names� r r �//usr/lib/python3/dist-packages/uaclient/snap.py�is_snapd_installed! s r )�
http_proxy�https_proxy�retry_sleepsr c C st t � st�d� dS | s|r0t�tjjdd�� | rPtj dddd�| �g|d� |rptj dddd �|�g|d� dS )
a
Configure snap to use http and https proxies.
:param http_proxy: http proxy to be used by snap. If None, it will
not be configured
:param https_proxy: https proxy to be used by snap. If None, it will
not be configured
:param retry_sleeps: Optional list of sleep lengths to apply between
retries. Specifying a list of [0.5, 1] tells subp to retry twice
on failure; sleeping half a second before the first retry and 1 second
before the second retry.
z6Skipping configure snap proxy. snapd is not installed.N�snap)�service�setr z
proxy.http={}�r zproxy.https={})
r �LOG�debug�event�infor ZSETTING_SERVICE_PROXY�formatr �subp)r r r r r r �configure_snap_proxy&