+
    g,
                         ^ RI t ^ RIHtHtHtHtHtHt ^ RIH	t	 ] P                  ! ]P                  ! ]4      4      tRtRtRt ! R R]	4      tR# )	    N)config
exceptionshttplogsecret_managerutil)AutoAttachInstancez/dev/lxd/sockz/1.0/ubuntu-proz/1.0/ubuntu-pro/tokenc                   r   a  ] tR t^t o ]V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R lR ltR	t	V t
R
# )LXDAutoAttachInstancec                    < V ^8  d   QhRS[ /#    returnbool)format__classdict__s   "5/usr/lib/python3/dist-packages/uaclient/clouds/lxd.py__annotate__"LXDAutoAttachInstance.__annotate__   s      4     c                    R # )T selfs   &r   	is_viableLXDAutoAttachInstance.is_viable   s    r   c                    < V ^8  d   QhRS[ /# r   r   )r   r   s   "r   r   r      s      T r   c                    R# )zKYes, but only once - is_pro_license_present doesn't
support wait_for_changeTr   r   s   &r   should_poll_for_pro_license1LXDAutoAttachInstance.should_poll_for_pro_license   s     r   c                &   < V ^8  d   QhRS[ RS[ /# )r   wait_for_changer   r   )r   r   s   "r   r   r      s       $ r   c                  V'       d   \         P                  ! 4       h\        P                  ! \        R \
        4      pVP                  ^8w  dD   \        P                  R\        P                  ! VP                  VP                  R7      R7       R# VP                  P                  RR4      R8w  d   \        P                  R4       R# R	# )
GETz4LXD instance API returned error for ubuntu-pro query)codebody)extraFguest_attachoffonzNguest_attach config is not turned on. The machine will not try to auto-attach.T)r   CancelProLicensePollingr   unix_socket_requestLXD_INSTANCE_API_SOCKET_PATH$LXD_INSTANCE_API_ENDPOINT_UBUNTU_PROr&   LOGerrorr   r(   r'   	json_dictgetinfo)r   r#   resps   &$ r   is_pro_license_present,LXDAutoAttachInstance.is_pro_license_present   s    4466''(0

 99IIFiiTYYTYY?    >>ne4<HH` r   c                :   < V ^8  d   QhRS[ P                  RS[/# )r   cfgr   )r   UAConfigstr)r   r   s   "r   r   r   1   s      V__  r   c                    \         P                  ! \        R\        4      pVP                  R8X  d   \
        P                  ! 4       hVP                  R8X  d   \
        P                  ! 4       hVP                  ^8w  dF   \
        P                  ! VP                  RP                  \        \        4      VP                  R7      hVP                  P                  RR4      p\        P                  P                  V4       V# )zc
Cloud-specific implementation of acquiring the pro token using whatever
method suits the platform
POSTi  i  zunix://{}{})r&   urlr'   guest_token )r   r-   r.   0LXD_INSTANCE_API_ENDPOINT_UBUNTU_PRO_GUEST_TOKENr&   r   LXDAutoAttachNotAvailableLXDAutoAttachNotAllowedExternalAPIErrorr   r'   r2   r3   r   secrets
add_secret)r   r9   r5   r?   s   &&  r   acquire_pro_token'LXDAutoAttachInstance.acquire_pro_token1   s    
 ''(<

 996688YY#4466YY#--YY!((0D YY  nn((;))+6r   r   N)__name__
__module____qualname____firstlineno__propertyr   r    r6   rG   __static_attributes____classdictcell__)r   s   @r   r   r      s5       
 4 r   r   )logginguaclientr   r   r   r   r   r   uaclient.cloudsr	   	getLoggerreplace_top_level_logger_namerI   r0   r.   r/   rA   r   r   r   r   <module>rU      sK     H H .::8DE. '8 $3J 0=. =r   