File manager - Edit - /usr/lib/python3/dist-packages/uaclient/daemon/__pycache__/poll_for_pro_license.cpython-310.pyc
Back
o =�xd� � @ s� d dl Z d dlZd dlmZmZmZmZmZ d dlm Z d dl mZ d dlm Z d dlmZ d dlmZ d dlmZ d d lmZ e �d �Zdedefd d�Zdefdd�ZdS )� N)�actions� exceptions�lock�system�util)�_is_attached)�AutoAttachCloudInstance)�UAAutoAttachAzureInstance)�UAAutoAttachGCPInstance)�cloud_instance_factory)�UAConfig)�retry_auto_attachzpro.daemon.poll_for_pro_license�cfg�cloudc C s� zt j| dd�� t�| |� W d � n1 sw Y W n' tyF } zt�|� t �� t�d� t � tj� W Y d }~d S d }~ww t� d� d S )Nzpro.daemon.attempt_auto_attach)r �lock_holderz%creating flag file to trigger retrieszSuccessful auto attach)r �SpinLockr �auto_attach� Exception�LOG�error�clear_lock_file_if_present�infor �create_filer �FLAG_FILE_PATH�debug)r r �e� r �F/usr/lib/python3/dist-packages/uaclient/daemon/poll_for_pro_license.py�attempt_auto_attach s ��� ��r c s� t j| jdd�rt�d� d S t| �jrt�d� d S t�� s&t�d� d S zt � � W n t jy; t�d� Y d S w t� fdd�t tfD ��}|sRt�d � d S � �� s]t�d � d S z� jdd�}W n t jyu t�d � Y d S t jy~ Y n w |r�t| � � d S | js�t�d� d S zt�� }� jdd�}t�� }W n t jy� t�d � Y d S t jy� t�| j� Y q�w t| �jr�t�d� d S |r�t| � � d S || dk r�t�d�| j�� t�| j� q�q�)Nzfeatures.disable_auto_attach)�config� path_to_valuez,Configured to not auto attach, shutting downzAlready attached, shutting downzNot on LTS, shutting downzNot on cloud, shutting downc 3 s � | ]}t � |�V qd S )N)� isinstance)�.0�cloud_instance�r r r � <genexpr>2 s � � �z'poll_for_pro_license.<locals>.<genexpr>z.Not on supported cloud platform, shutting downz(Not on supported instance, shutting downF)�wait_for_changezCancelling pollingz5Configured to not poll for pro license, shutting downT� zdwait_for_change returned quickly and no pro license present. Waiting {} seconds before polling again)r �is_config_value_truer r r r �is_attachedr �is_current_series_ltsr r �CloudFactoryError�anyr r �should_poll_for_pro_license�is_pro_license_present�CancelProLicensePolling�DelayProLicensePollingr �poll_for_pro_license�time�sleep�polling_error_retry_delay�format)r �is_supported_cloud�pro_license_present�start�endr r$ r r1 s� � ��� � � � � ���r1 )�loggingr2 �uaclientr r r r r �(uaclient.api.u.pro.status.is_attached.v1r �uaclient.cloudsr �uaclient.clouds.azurer �uaclient.clouds.gcpr �uaclient.clouds.identityr �uaclient.configr �uaclient.daemonr � getLoggerr r r1 r r r r �<module> s
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings