Current File : //usr/lib/python3/dist-packages/uaclient/clouds/__pycache__/__init__.cpython-312.pyc
�

��g	���ddlZddlmZmZddlmZmZGd�dej��ZGd�deej��Z	y)	�N)�Any�Dict)�config�contractc���eZdZeej
defd���Zej
dejde
fd��Zej
defd��Zej
dedefd��Z
y)	�AutoAttachInstance�returnc��y)z?Return True if the machine is a viable AutoAttachCloudInstance.N���selfs �:/usr/lib/python3/dist-packages/uaclient/clouds/__init__.py�	is_viablezAutoAttachInstance.is_viable���	
��cfgc��y)�{
        Cloud-specific implementation of acquiring the pro token using whatever
        method suits the platform
        Nr)r
rs  r�acquire_pro_tokenz$AutoAttachInstance.acquire_pro_token���	
rc��y)zw
        Cloud-specific checks for whether the daemon should continously poll
        for Ubuntu Pro licenses.
        Nrrs r�should_poll_for_pro_licensez.AutoAttachInstance.should_poll_for_pro_licenserr�wait_for_changec��y)z1
        Check for an Ubuntu Pro license
        Nr)r
rs  r�is_pro_license_presentz)AutoAttachInstance.is_pro_license_presents��
	
rN)�__name__�
__module__�__qualname__�property�abc�abstractmethod�boolrr�UAConfig�strrrrrrrrrs���
����
�4�
���
�	���
�V�_�_�
��
��
�	���
�T�
��
�	���
��
�$�
��
rr)�	metaclassc��eZdZeej
deeeffd���Z	eej
defd���Z
dejdefd�Z
y)�PublicCloudAutoAttachInstancer	c��y)z=Return the identity document representing this cloud instanceNrrs r�identity_docz*PublicCloudAutoAttachInstance.identity_doc'rrc��y)z=Return a string of the cloud type on which this instance runsNrrs r�
cloud_typez(PublicCloudAutoAttachInstance.cloud_type-rrrc��tj|�}|j|j|j��}|dS)r)r+�data�
contractToken)r�UAContractClient�%get_contract_token_for_cloud_instancer+r))r
r�contract_client�token_responses    rrz/PublicCloudAutoAttachInstance.acquire_pro_token3sF��
#�3�3�C�8��(�N�N����T�->�->�O�
���o�.�.rN)rrrrr r!rr$rr)r+rr#rrrrr'r'&sq��
����
�d�3��8�n�
���
�����
�C�
���
�	/�V�_�_�	/��	/rr')
r �typingrr�uaclientrr�ABCMetarr'rrr�<module>r6s1��
��%�
�3�;�;�
�>/�$6�#�+�+�/r