File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/daemon.tar
Back
__pycache__/poll_for_pro_license.cpython-310.pyc 0000644 00000006070 15027667671 0015677 0 ustar 00 o �ϴf� � @ 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 �e�e��Zd edefdd �Zd efdd�ZdS )� N)�actions� exceptions�lock�system�util)�_is_attached)�AutoAttachCloudInstance)�UAAutoAttachAzureInstance)�UAAutoAttachGCPInstance)�cloud_instance_factory)�UAConfig)�retry_auto_attach�cfg�cloudc C s� zt jdd�� t�| |� W d � n1 sw Y W n' tyE } zt�|� t �� t�d� t � tj� W Y d }~d S d }~ww t�d� d S )Nzpro.daemon.attempt_auto_attach)�lock_holderz%creating flag file to trigger retrieszSuccessful auto attach) r � RetryLockr �auto_attach� Exception�LOG�error�clear_lock_file_if_present�infor �create_filer �FLAG_FILE_PATH)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>0 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 %d 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)r �is_supported_cloud�pro_license_present�start�endr r# r r0 s� � ��� � � � � ��r0 )�loggingr1 �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 � getLogger�replace_top_level_logger_name�__name__r r r0 r r r r �<module> s __pycache__/__init__.cpython-310.pyc 0000644 00000002320 15027667671 0013232 0 ustar 00 o �ϴf� � @ s� d dl Z d dlZd dlmZ d dlmZmZmZ d dlm Z d dl mZ e �e� e��Zej�edd�Zdd � Zd d� Zde fd d�ZdS )� N)�TimeoutExpired)� exceptions�system�util)�UAConfig)�DEFAULT_DATA_DIR�messageszmotd-auto-attach-statusc C �T zt jg d�dd� W d S tjtfy) } ztj| | d� W Y d } ~ d S d } ~ ww )N)� systemctl�start�ubuntu-advantage.service� @��timeout��exc_info�r �subpr �ProcessExecutionErrorr �LOG�warning��e� r �:/usr/lib/python3/dist-packages/uaclient/daemon/__init__.pyr � ���r c C r )N)r �stopr r r r r r r r r r r r �cfgc C s ddl m} |�| � d S )Nr )�retry_auto_attach)�uaclient.daemonr �cleanup)r r r r r r "