/usr/lib/python3/dist-packages/uaclient/__pycache__
NameSizeModeActions
actions.cpython-310.pyc113810644editdlrm
apt.cpython-310.pyc283670644editdlrm
apt_news.cpython-310.pyc73460644editdlrm
config.cpython-310.pyc137600644editdlrm
contract.cpython-310.pyc248990644editdlrm
contract_data_types.cpython-310.pyc80680644editdlrm
data_types.cpython-310.pyc147880644editdlrm
defaults.cpython-310.pyc29130644editdlrm
event_logger.cpython-310.pyc78400644editdlrm
exceptions.cpython-310.pyc250390644editdlrm
gpg.cpython-310.pyc10250644editdlrm
livepatch.cpython-310.pyc106950644editdlrm
lock.cpython-310.pyc46350644editdlrm
log.cpython-310.pyc46330644editdlrm
secret_manager.cpython-310.pyc12560644editdlrm
security_status.cpython-310.pyc165980644editdlrm
snap.cpython-310.pyc64710644editdlrm
status.cpython-310.pyc183610644editdlrm
system.cpython-310.pyc227620644editdlrm
types.cpython-310.pyc4720644editdlrm
update_contract_info.cpython-310.pyc13320644editdlrm
upgrade_lts_contract.cpython-310.pyc29920644editdlrm
util.cpython-310.pyc135250644editdlrm
version.cpython-310.pyc24990644editdlrm
yaml.cpython-310.pyc11780644editdlrm
__init__.cpython-310.pyc1440644editdlrm
Edit: /usr/lib/python3/dist-packages/uaclient/__pycache__/snap.cpython-310.pyc (6471B)
o Ki @sddlZddlZddlmZmZmZddlmZmZm Z m Z m Z m Z m Z mZdZgdZdZdZdZd Ze ZeeeZed d efd efd efdefdefgZdefddZdefddZ   d0deedeedeee ddfddZ! d1dedeee ddfddZ"dedeefddZ#deefd d!Z$d"d#Z%d$ej&fd%d&Z'  'd2d(edeed)efd*d+Z(d(efd,d-Z)d(edefd.d/Z*dS)3N)List NamedTupleOptional)apiapt event_logger exceptionshttpmessagessystemutilz /usr/bin/snap)g?g?g@z proxy.httpz proxy.httpsz/run/snapd.socketz /v2/snaps/{} SnapPackagenameversionrevisionchannel publisherreturncCs dtvS)z(Returns whether or not snap is installedsnapd)rget_installed_packages_namesrr//usr/lib/python3/dist-packages/uaclient/snap.pyis_snapd_installed's rcCstddtDS)z3Returns whether or not snapd is installed as a snapcss|]}|jdkVqdS)rNr).0snaprrr .sz/is_snapd_installed_as_a_snap..)anyget_installed_snapsrrrris_snapd_installed_as_a_snap,sr http_proxy https_proxy retry_sleepscCsxts tddS|s|rttjjdd|r(tj dddd|g|d|r:tj dddd |g|ddSdS) 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={}) rLOGdebugeventinfor SETTING_SERVICE_PROXYformatr subp)r r!r"rrrconfigure_snap_proxy1s   r- protocol_typecCs4ts tddStjdddd|g|ddS)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.Nrunsetr zproxy.{}r%)rr&r'r r,r+)r.r"rrrunconfigure_snap_proxyVs  r0keycCs8ztddd|g\}}|WStjyYdSw)z Gets the config value from snap. :param protocol: can be any valid snap config option :return: the value of the snap config option, or None if not set rgetr N)r r,striprProcessExecutionError)r1out_rrrget_config_option_valueks  r7cCsRtgd\}}|}|dd}g}|D]}|d}|t|q|S)N)rlistz--colorneverz --unicoder9r)r r, splitlinessplitappend get_snap_info)r5r6appssnapslinerrrrrxs  rc Csttjjddz ttWntj y.}zt dt |WYd}~nd}~wwz t jgdtjdWdStjyHtw)Nzstandard Ubunturzs.          r>)NNN)N)NF)+loggingrQtypingrrruaclientrrrrr r r r rPrYHTTP_PROXY_OPTIONHTTPS_PROXY_OPTIONrirgget_event_loggerr( getLoggerreplace_top_level_logger_name__name__r&rGr boolrrfloatr-r0r7rrKProgressWrapperrWr[r^r>rrrrst(    &