/usr/lib/python3/dist-packages/uaclient/__pycache__
Edit: /usr/lib/python3/dist-packages/uaclient/__pycache__/snap.cpython-310.pyc (6471B)
o
Ki @ s d dl Z d dlZd dlmZmZmZ d dlmZmZm Z m
Z
mZmZm
Z
mZ dZg dZdZdZdZd Ze Ze eeZed
defdefd
efdefdefgZdefddZdefddZ d0dee dee deee ddfddZ! d1dedeee ddfddZ"dedee fddZ#dee fd d!Z$d"d# Z%d$ej&fd%d&Z' 'd2d(edee d)efd*d+Z(d(efd,d-Z)d(edefd.d/Z*dS )3 N)List
NamedTupleOptional)apiaptevent_logger
exceptionshttpmessagessystemutilz
/usr/bin/snap)g ?g ?g @z
proxy.httpzproxy.httpsz/run/snapd.socketz/v2/snaps/{}SnapPackagenameversionrevisionchannel publisherreturnc C s dt v S )z(Returns whether or not snap is installedsnapd)r get_installed_packages_names r r //usr/lib/python3/dist-packages/uaclient/snap.pyis_snapd_installed' s r c C s t dd t D S )z3Returns whether or not snapd is installed as a snapc s s | ]}|j d kV qdS )r Nr ).0snapr r r
. s z/is_snapd_installed_as_a_snap..)anyget_installed_snapsr r r r is_snapd_installed_as_a_snap, s r
http_proxyhttps_proxyretry_sleepsc C sx t s
td dS | s|rttjjdd | r(tj dddd| g|d |r:tj dddd |g|d dS 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.Nr )servicesetr z
proxy.http={}r" zproxy.https={})
r LOGdebugeventinfor
SETTING_SERVICE_PROXYformatr subp)r r! r" r r r configure_snap_proxy1 s
r-
protocol_typec C s4 t s
td dS tjdddd| g|d dS )a
Unset snap configuration settings for http and https proxies.
:param protocol_type: String either http or https
: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.
z8Skipping unconfigure snap proxy. snapd is not installed.Nr unsetr zproxy.{}r% )r r&