+
    =l j  ã            	       óŽ  € ^ RI t ^ RIt^ RIHtHtHt ^ RIHtHtH	t	H
t
HtHtHtHt Rt. R$OtRtRtRtRt]	P*                  ! 4       t] P.                  ! ]P0                  ! ]4      4      t]! R	R
]3R]3R]3R]3R]3.4      tR R ltR R ltR%R R lltR&R R llt R R lt!R R lt"R t#R R lt$R'R R llt%R  R! lt&R" R# lt'R# )(é    N)ÚListÚ
NamedTupleÚOptional)ÚapiÚaptÚevent_loggerÚ
exceptionsÚhttpÚmessagesÚsystemÚutilz/usr/bin/snapz
proxy.httpzproxy.httpsz/run/snapd.socketz/v2/snaps/{}ÚSnapPackageÚnameÚversionÚrevisionÚchannelÚ	publisherc                ó$   € V ^8„  d   QhR\         /# ©é   Úreturn©Úbool)Úformats   "Ú//usr/lib/python3/dist-packages/uaclient/snap.pyÚ__annotate__r   '   s   € ÷ 9ñ 9œDñ 9ó    c                 ó2   € R\         P                  ! 4       9   # )z(Returns whether or not snap is installedÚsnapd)r   Úget_installed_packages_names© r   r   Úis_snapd_installedr"   '   s   € à”c×6Ò6Ó8Ñ8Ð8r   c                ó$   € V ^8„  d   QhR\         /# r   r   )r   s   "r   r   r   ,   s   € ÷ Iñ I¤dñ Ir   c                 óŠ   € \         ;QJ d$    R \        4        4       F  '       g   K   R# 	  R# ! R \        4        4       4      # )z3Returns whether or not snapd is installed as a snapc              3   ó>   "  € T F  qP                   R 8H  x € K  	  R# 5i)r   N©r   )Ú.0Úsnaps   & r   Ú	<genexpr>Ú/is_snapd_installed_as_a_snap.<locals>.<genexpr>.   s   é € ÐGÑ1F¨—	‘	˜WÖ$Ó1Fùs   ‚TF)ÚanyÚget_installed_snapsr!   r   r   Úis_snapd_installed_as_a_snapr-   ,   s3   € ç‹3ÑGÔ1DÔ1FÓG�3Œ3ÐHŠ3ÐHˆ3ÑGÔ1DÔ1FÓGÓHÐHr   c                ó˜   € V ^8„  d   QhR\         \        ,          R\         \        ,          R\         \        \        ,          ,          RR/# )r   Ú
http_proxyÚhttps_proxyÚretry_sleepsr   N)r   Ústrr   Úfloat)r   s   "r   r   r   1   sA   € ÷ "
ñ "
Üœ•ð"
äœ#•ð"
ô œ4¤�;Õ'ð"
ð 
ñ	"
r   c                óª  € \        4       '       g   \        P                  R4       R# V '       g	   V'       d4   \        P	                  \
        P                  P                  RR7      4       V '       d,   \        P                  ! RRRRP                  V 4      .VR7       V'       d.   \        P                  ! RRRR	P                  V4      .VR7       R# R# )
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(   )ÚserviceÚsetr   zproxy.http={}©r1   zproxy.https={})
r"   ÚLOGÚdebugÚeventÚinfor   ÚSETTING_SERVICE_PROXYr   r   Úsubp)r/   r0   r1   s   &&&r   Úconfigure_snap_proxyr>   1   sœ   € ô" ×ÒÜ�	‰	ÐJÔKÙç—[Ü�
‰
”8×1Ñ1×8Ñ8ÀÐ8ÓHÔIçÜ�ŠØ�U˜H o×&<Ñ&<¸ZÓ&HÐIØ%õ	
÷
 Ü�ŠØ�U˜HÐ&6×&=Ñ&=¸kÓ&JÐKØ%÷	
ñ r   c                ó`   € V ^8„  d   QhR\         R\        \        \        ,          ,          RR/# )r   Úprotocol_typer1   r   N)r2   r   r   r3   )r   s   "r   r   r   V   s-   € ÷ ñ ÜðÜ&.¬t´E­{Õ&;ðà	ñr   c                óª   € \        4       '       g   \        P                  R4       R# \        P                  ! RRRRP                  V 4      .VR7       R# )ad  
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   zproxy.{}r7   )r"   r8   r9   r   r=   r   )r@   r1   s   &&r   Úunconfigure_snap_proxyrC   V   sC   € ô ×ÒÜ�	‰	ÐLÔMÙÜ
‡K‚KØ	�˜( J×$5Ñ$5°mÓ$DÐEØ!÷r   c                óF   € V ^8„  d   QhR\         R\        \         ,          /# )r   Úkeyr   )r2   r   )r   s   "r   r   r   k   s   € ÷ 
ñ 
¤ð 
¬´#­ñ 
r   c                ó”   €  \         P                  ! RRRV .4      w  rVP                  4       #   \        P                   d     R# i ; i)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
r(   Úgetr   N)r   r=   Ústripr	   ÚProcessExecutionError)rE   ÚoutÚ_s   &  r   Úget_config_option_valuerL   k   sD   € ðÜ—’˜f e¨X°sÐ;Ó<‰ˆØ�y‰y‹{ÐøÜ×+Ñ+ô Úðús   ‚+. ®AÁAc                ó:   € V ^8„  d   QhR\         \        ,          /# r   )r   r   )r   s   "r   r   r   x   s   € ÷ ñ œT¤+Õ.ñ r   c                  óä   € \         P                  ! . RO4      w  rV P                  4       pVR,          p. pV F4  pVP                  4       ^ ,          pVP	                  \        V4      4       K6  	  V# )r(   :é   NN)r(   Úlistz--colorÚneverz	--unicoderQ   )r   r=   Ú
splitlinesÚsplitÚappendÚget_snap_info)rJ   rK   ÚappsÚsnapsÚliner(   s         r   r,   r,   x   sb   € Ü�[Š[ÚBó�F€Cð �>‰>Ó€DØ��8€DØ€EÛˆØ�z‰z‹|˜A�ˆØ�‰”] 4Ó(Ö)ñ ð €Lr   c                  óð  € \         P                  \        P                  P	                  R R7      4        \
        P                  ! \
        P                  ! 4       4        \        P                  ! . RO\
        P                  R7       R#   \        P                   d*   p \        P                  R\        T 4      4        Rp ? LdRp ? ii ; i  \        P                    d    \        P"                  ! 4       hi ; i)zstandard Ubuntur&   z<Trying to install snapd. Ignoring apt-get update failure: %sNr7   )zapt-getÚinstallz--assume-yesr   )r:   r;   r   ÚAPT_UPDATING_LISTr   r   Úupdate_sources_listÚget_system_sources_filer	   ÚUbuntuProErrorr8   r9   r2   r   r=   ÚAPT_RETRIESrI   ÚCannotInstallSnapdError)Úes    r   Úinstall_snapdrb   †   s²   € Ü	‡J�JŒx×)Ñ)×0Ñ0Ð6GÐ0ÓHÔIð
Ü×Ò¤× ;Ò ;Ó =Ô>ð3Ü�ŠÚ;ÜŸ™÷	
øô ×$Ñ$ô 
Ü�	‰	ØJÜ�‹F÷	
ñ 	
ûð
ûô ×+Ñ+ô 3Ü×0Ò0Ó2Ð2ð3ús#   µ)B	 Á(C
 Â	CÂCÃCÃ
+C5c                ó8   € V ^8„  d   QhR\         P                  /# )r   Úprogress)r   ÚProgressWrapper)r   s   "r   r   r   ˜   s   € ÷ 
ñ 
¤×!4Ñ!4ñ 
r   c                 ób  €  \         P                  ! \        R RR.RR7       R#   \        P                   dv   p\
        P                  ! R\        T4      P                  4       4      '       d<   \        P                  R4       T P                  R\        P                  4        Rp?R# h Rp?ii ; i)	Úwaitr   zseed.loadedT©Úcapturezunknown command .*waitz9Detected version of snapd that does not have wait commandr;   N)r   r=   ÚSNAP_CMDr	   rI   ÚreÚsearchr2   Úlowerr8   ÚwarningÚemitr   ÚSNAPD_DOES_NOT_HAVE_WAIT_CMD)rd   ra   s   & r   Úrun_snapd_wait_cmdrq   ˜   s{   € ð	Ü�Š”X˜v x°Ð?È×NøÜ×+Ñ+ô Ü�9Š9Ð.´°A³·±³×?Ò?Ü�K‰KØKôð �M‰M˜&¤(×"GÑ"G×HÒHàûðús   ‚ $ ¤B.¹A)B)Â(B)Â)B.c                óR   € V ^8„  d   QhR\         R\        \         ,          R\        /# )r   r(   r   Úclassic_confinement_support)r2   r   r   )r   s   "r   r   r   ¥   s*   € ÷ ñ Ü
ðä”c�]ðô "&ñr   c                 ó¸   € \         R V .pV'       d   VR.,          pV'       d   VRP                  V4      .,          p\        P                  ! VR\        R7       R# )rZ   z	--classicz--channel={}T)ri   r1   N)rj   r   r   r=   ÚSNAP_INSTALL_RETRIES)r(   r   rs   Úcmds   &&& r   Úinstall_snaprw   ¥   sO   € ô
 �Y Ð
%€Cç"Ø�ˆ}ÕˆçØ�×%Ñ% gÓ.Ð/Õ/ˆä
‡K‚KØØÜ)÷r   c                ó$   € V ^8„  d   QhR\         /# )r   r(   )r2   )r   s   "r   r   r   ¹   s   € ÷ ;ñ ;”sñ ;r   c                 óD   € \         P                  ! \        R V .RR7       R# )ÚrefreshTrh   N)r   r=   rj   ©r(   s   &r   Úrefresh_snapr|   ¹   s   € Ü
‡K‚K”˜9 dÐ+°T×:r   c                ó0   € V ^8„  d   QhR\         R\        /# )r   r(   r   )r2   r   )r   s   "r   r   r   ½   s   € ÷ ñ œð ¤ñ r   c           
      ó  € \         P                  V 4      p \        P                  ! \        R V4      pVP
                  ^È8w  d›   VP
                  R8X  dH   VP                  P                  R/ 4      P                  R4      R8X  d   \        P                  ! V R7      hVP                  P                  R/ 4      P                  R4      p\        P                  ! VR7      h TP                  P                  R/ 4      p\        TP                  RR	4      TP                  R
R	4      TP                  RR	4      TP                  RR	4      TP                  R/ 4      P                  RR	4      R7      #   \         d    \        P                  ! 4       hi ; i)ÚGETi”  ÚresultÚkindzsnap-not-foundr{   Úmessage)Úerrorr   Ú r   r   r   r   Úusername)r   r   r   r   r   )ÚSNAPD_SNAPS_APIr   r
   Úunix_socket_requestÚSNAPD_SOCKET_PATHÚcodeÚ	json_dictrG   r	   ÚSnapNotInstalledErrorÚUnexpectedSnapdAPIErrorÚConnectionRefusedErrorÚSnapdAPIConnectionRefusedr   )r(   ÚurlÚrespÚ	error_msgÚ	snap_infos   &    r   rU   rU   ½   sM  € Ü
×
 Ñ
  Ó
&€Cð5Ü×'Ò'Ô(9¸5À#ÓFˆà�9‰9˜Ôà—	‘	˜SÔ Ø—N‘N×&Ñ& x°Ó4×8Ñ8¸Ó@Ø#ô$ô !×6Ò6¸DÔAÐAà ŸN™N×.Ñ.¨x¸Ó<×@Ñ@ÀÓK�	Ü ×8Ò8¸yÔIÐIð ð —‘×"Ñ" 8¨RÓ0€IÜØ�]‰]˜6 2Ó&Ø—‘˜i¨Ó,Ø—‘˜z¨2Ó.Ø—‘˜i¨Ó,Ø—-‘- ¨RÓ0×4Ñ4°ZÀÓDôð øô	 "ô 5Ü×2Ò2Ó4Ð4ð5ús   —CE+ Å+!F)g      à?g      ð?g      @)NNN)N)NF)(Úloggingrk   Útypingr   r   r   Úuaclientr   r   r   r	   r
   r   r   r   rj   ru   ÚHTTP_PROXY_OPTIONÚHTTPS_PROXY_OPTIONrˆ   r†   Úget_event_loggerr:   Ú	getLoggerÚreplace_top_level_logger_nameÚ__name__r8   r2   r   r"   r-   r>   rC   rL   r,   rb   rq   rw   r|   rU   r!   r   r   Ú<module>rœ      sá   ðÛ Û 	ß -Ñ -÷	÷ 	ó 	ð €Ú&Ð Ø Ð Ø"Ð Ø'Ð Ø €à×%Ò%Ó'€Ø×Ò˜×:Ò:¸8ÓDÓE€ñ Øà	�ˆØ	�CÐØ	�SÐØ	�CÐØ	�cÐðó	€õ9õ
I÷
"
÷Jõ*
õò3õ$
÷õ(;÷r   