File: //lib/python3/dist-packages/uaclient/__pycache__/snap.cpython-310.pyc
o
�~cB � @ s d dl Z d dlZd dlmZmZ d dlmZmZmZm Z m
Z
dZg d�ZdZ
dZdZe�� Zd efd
d�Z ddee d
ee deee d dfdd�Z ddedeee d dfdd�Zded ee fdd�Zded ee fdd�ZG dd� d�Zd ee fdd�ZdS ) � N)�List�Optional)�apt�event_logger�
exceptions�messages�systemz
/usr/bin/snap)g �?g �?g @z
proxy.httpzproxy.httpsu …�returnc C s dt �� v S )z(Returns whether or not snap is installed�snapd)r �get_installed_packages_names� r r �//usr/lib/python3/dist-packages/uaclient/snap.py�is_installed s r �
http_proxy�https_proxy�retry_sleepsc C s� t �t�st�d�t�� dS | s|rt�tj jdd�� | r-t j
dddd�| �g|d� |r?t j
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.
z1Skipping configure snap proxy. {} does not exist.N�snap)�service�setr z
proxy.http={}�r zproxy.https={})r �which�SNAP_CMD�logging�debug�format�event�infor �SETTING_SERVICE_PROXY�subp)r r r r r r
�configure_snap_proxy s(
���
��r �
protocol_typec C s>