HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/uaclient/clouds/__pycache__/azure.cpython-310.pyc
o

0xvc��@s�ddlZddlmZmZddlmZddlmZmZm	Z	ddl
mZdZdZ
ede
ed	e
d
�ZdZdZd
ZGdd�de�ZdS)�N)�Any�Dict)�	HTTPError)�
exceptions�system�util)�AutoAttachCloudInstancez http://169.254.169.254/metadata/z
2020-09-01zattested/document?api-version=zinstance/compute?api-version=)�pkcs7�computez#/sys/class/dmi/id/chassis_asset_tagz%/var/lib/cloud/seed/azure/ovf-env.xmlz 7783-7084-3265-9085-8269-3286-77c@s|eZdZeejegd�d�deee	ffdd���Z
edefdd��Zedefdd	��Z
defd
d�Zdedefd
d�ZdS)�UAAutoAttachAzureInstance)�rr)�retry_sleeps�returncCsTi}tt���D]\}}tj|ddidd�\}}|dkr#|d||<q|||<q|S)N�Metadata�truer)�headers�timeoutr	�	signature)�sorted�	IMDS_URLS�itemsr�readurl)�self�	responses�key�url�url_response�_headers�r�7/usr/lib/python3/dist-packages/uaclient/clouds/azure.py�identity_docs

�
z&UAAutoAttachAzureInstance.identity_doccC�dS)N�azurer�rrrr�
cloud_type'�z$UAAutoAttachAzureInstance.cloud_typecCs2tj�t�rt�t�}t|��krdStj�t�S)z&This machine is a viable AzureInstanceT)	�os�path�exists�DMI_CHASSIS_ASSET_TAGr�	load_file�AZURE_CHASSIS_ASSET_TAG�strip�AZURE_OVF_ENV_FILE)r�chassis_asset_tagrrr�	is_viable+s

z#UAAutoAttachAzureInstance.is_viablecCr!)�UnsupportedFrr#rrr�should_poll_for_pro_license4r%z5UAAutoAttachAzureInstance.should_poll_for_pro_license�wait_for_changecCst���)N)r�InPlaceUpgradeNotSupportedError)rr2rrr�is_pro_license_present8sz0UAAutoAttachAzureInstance.is_pro_license_presentN)�__name__�
__module__�__qualname__�propertyr�retryrr�strrr r$�boolr/r1r4rrrrrsr)r&�typingrr�urllib.errorr�uaclientrrr�uaclient.cloudsr�
IMDS_BASE_URL�API_VERSIONrr)r-r+rrrrr�<module>s

�