AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/uaclient/daemon/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/uaclient/daemon/__pycache__/retry_auto_attach.cpython-310.pyc
o

F��c��@s�ddlZddlZddlZddlmZmZmZmZddlmZ	ddl
mZmZddl
mZddlmZddlmZe�d�Zgd	�Zd
Zdedefd
d�Zdefdd�Zdeddfdd�ZdS)�N)�
exceptions�lock�messages�system)r)�FullAutoAttachOptions�full_auto_attach)�UAConfig)�AUTO_ATTACH_STATUS_MOTD_FILE)�state_fileszpro.daemon.retry_auto_attach)�riii i@8�pr�Qr
��r��r�Fr逗rz./run/ubuntu-advantage/flags/auto-attach-failed�e�returncCst|tj�r
tj�|j�St|tj�rtjSt|tj	�r$tj
j|jd�St|tj�r1tj
�|j�St|tj�r:tjSt|tj�rh|jrZ|jrQtjj|j|jd�}ntjj|jd�}ntj}|d�t|��7}|St|tj�rtd�|j�St�d�|��t|�p�tjS)N)�pid)�code�url)rz: "{}"z"{}"zUnexpected exception: {})�
isinstance�api_exceptions�InvalidProImager�$RETRY_ERROR_DETAIL_INVALID_PRO_IMAGE�format�contract_server_msg�NonAutoAttachImageError�(RETRY_ERROR_DETAIL_NON_AUTO_ATTACH_IMAGE�
LockHeldError�RETRY_ERROR_DETAIL_LOCK_HELDr�ContractAPIError�%RETRY_ERROR_DETAIL_CONTRACT_API_ERROR�	api_error�ConnectivityError�%RETRY_ERROR_DETAIL_CONNECTIVITY_ERROR�UrlErrorrr�!RETRY_ERROR_DETAIL_URL_ERROR_CODE� RETRY_ERROR_DETAIL_URL_ERROR_URL�$RETRY_ERROR_DETAIL_URL_ERROR_GENERIC�str�UserFacingError�msg�LOG�error�RETRY_ERROR_DETAIL_UNKNOWN)r�failure_reason�r1�C/usr/lib/python3/dist-packages/uaclient/daemon/retry_auto_attach.py�,full_auto_attach_exception_to_failure_reason(s<�����r3�cfgcCs2tj��tj��t�t�|j�dt	j
�dS)N�)r
�retry_auto_attach_state_file�delete�retry_auto_attach_options_filer�ensure_file_absentr	�notice_file�remover�AUTO_ATTACH_RETRY_NOTICE_PREFIX)r4r1r1r2�cleanupNs


r=cCs�|jrdStj��}|dur|j}t|d�}|j}nd}t}d}t|�D]�\}}tj�	tj
j�}|tj|d�}|j
ddd�}tj�tj|||d��|}	|	durVtj}	z|��}Wn	tyeYnwtjj||d|	|��d�}
t�t|
d�z(tj|dd	��|j�d
tj�|j�d
|
�Wd�n1s�wYWn
t j!y�Ynwt"�#|�|jr�n`ztj$��}t%�}|dur�|j&|_&|j'|_'t(|�WnDt)j*y�t+�,d�Yn5t)j-y�}
z
t+�.|
j/�WYd}
~
n d}
~
wt�y}
zt0|
�}t+�1|
�WYd}
~
q%d}
~
wwt2|�|j�sVtj�tjt3t�|d��|}	|	du�r9tj}	tj4jt3t�d|	d�}
t�t|
d�|j�d
|
�dSdS)
Nr)�seconds)�second�microsecond)�interval_indexr0�)�num_attempts�reason�next_run_datestringz

z+pro.daemon.retry_auto_attach.notice_updates)r4�lock_holderr5z&already attached, ending retry service)rCrD)5�is_attachedr
r6�readrA�RETRY_INTERVALSr0�	enumerate�datetime�now�timezone�utc�	timedelta�replace�write�RetryAutoAttachStaterr/�
astimezone�	Exception�AUTO_ATTACH_RETRY_NOTICEr�	isoformatr�
write_filer	r�SpinLockr:r;r<�addrr�time�sleepr8r�enable�enable_betarr�AlreadyAttachedErrorr-�info�EntitlementsNotEnabledError�warningr,r3r.r=�len�&AUTO_ATTACH_RETRY_TOTAL_FAILURE_NOTICE)r4�persisted_state�offset�	intervalsr0�index�interval�last_attempt�next_attempt�
msg_reason�auto_attach_status_msg�persisted_options�optionsrr1r1r2�retry_auto_attachUs�
���
�������
�
�����
����ro)rK�loggingrZ�uaclientrrrr�uaclient.apir�2uaclient.api.u.pro.attach.auto.full_auto_attach.v1rr�uaclient.configr�uaclient.daemonr	�uaclient.filesr
�	getLoggerr-rI�FLAG_FILE_PATHrTr*r3r=ror1r1r1r2�<module>s
&

Anon7 - 2022
AnonSec Team