/usr/lib/python3/dist-packages/uaclient/clouds/__pycache__
NameSizeModeActions
aws.cpython-310.pyc53770644editdlrm
azure.cpython-310.pyc28880644editdlrm
gcp.cpython-310.pyc45420644editdlrm
identity.cpython-310.pyc31230644editdlrm
lxd.cpython-310.pyc25450644editdlrm
__init__.cpython-310.pyc25820644editdlrm
Edit: /usr/lib/python3/dist-packages/uaclient/clouds/__pycache__/lxd.cpython-310.pyc (2545B)
o Ki, @sdddlZddlmZmZmZmZmZmZddlm Z e e e Z dZdZdZGddde ZdS) N)config exceptionshttplogsecret_managerutil)AutoAttachInstancez /dev/lxd/sockz/1.0/ubuntu-proz/1.0/ubuntu-pro/tokenc@sReZdZedefddZdefddZdedefddZd ej de fd d Z d S) LXDAutoAttachInstancereturncCdS)NTselfr r 5/usr/lib/python3/dist-packages/uaclient/clouds/lxd.py is_viableszLXDAutoAttachInstance.is_viablecCr )zSYes, but only once - is_pro_license_present doesn't support wait_for_changeTr r r r rshould_poll_for_pro_licensesz1LXDAutoAttachInstance.should_poll_for_pro_licensewait_for_changecCsh|rtttdt}|jdkr"tjdt j |j|j dddS|j ddd kr2td dSd S) NGETz4LXD instance API returned error for ubuntu-pro query)codebody)extraF guest_attachoffonzNguest_attach config is not turned on. The machine will not try to auto-attach.T)rCancelProLicensePollingrunix_socket_requestLXD_INSTANCE_API_SOCKET_PATH$LXD_INSTANCE_API_ENDPOINT_UBUNTU_PROrLOGerrorrrr json_dictgetinfo)rrrespr r ris_pro_license_presents& z,LXDAutoAttachInstance.is_pro_license_presentcfgcCsvttdt}|jdkrt|jdkrt|jdkr,tj|jd tt|j d|j dd}t j||S) z{ Cloud-specific implementation of acquiring the pro token using whatever method suits the platform POSTiirz unix://{}{})rurlr guest_token)rrr0LXD_INSTANCE_API_ENDPOINT_UBUNTU_PRO_GUEST_TOKENrrLXDAutoAttachNotAvailableLXDAutoAttachNotAllowedExternalAPIErrorformatrr!r"rsecrets add_secret)rr&r$r)r r racquire_pro_token1s*    z'LXDAutoAttachInstance.acquire_pro_tokenN) __name__ __module__ __qualname__propertyboolrrr%rUAConfigstrr2r r r rr s r )logginguaclientrrrrrruaclient.cloudsr getLoggerreplace_top_level_logger_namer3rrrr+r r r r rs