%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/uaclient/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/uaclient/__pycache__/upgrade_lts_contract.cpython-312.pyc

�

�Hcf���dZddlZddlZddlZddlmZmZmZmZm	Z	ddl
mZddlm
Z
dddd	d
dd�Zeje	j e��Zd
e
ddfd�Zd�Zy)a�
This function is called from lib/upgrade_lts_contract.py and from
lib/reboot_cmds.py

This function should be used after running do-release-upgrade in a machine.
It will detect any contract deltas between the release before
do-release-upgrade and the current release. If we find any differences in
the uaclient contract between those releases, we will apply that difference
in the upgraded release.

For example, suppose we are on Trusty and we are upgrading to Xenial. We found
that the apt url for esm services on trusty:

https://esm.ubuntu.com/ubuntu

While on Xenial, the apt url is:

https://esm.ubuntu.com/infra/ubuntu

This script will detect differences like that and update the Xenial system
to reflect them.
�N)�contract�defaults�messages�system�util)�_is_attached)�UAConfig�trusty�xenial�bionic�focal�lunar�jammy)rrr
r�mantic�noble�cfg�returnc�V�tjd�t|�jstjd�ytjd�t	j
ddgddg��\}}|rt
tj�t	j�j}tj|�}|�Yt
tjj|�	��tjd
|t�t!j"d�t%|��j&j(}t%|��j&j(}d}|rPtjd�t+j,d
�t	j
ddgddg��\}}|dz
}|r�Ptjd||�t
tj.�t1j2|||dd��tjd|�t
tj4�y)Nz%Check whether to upgrade-lts-contractz4Skipping upgrade-lts-contract. Machine is unattachedzStarting upgrade-lts-contract.�lsofz/var/lib/apt/lists/lockr�)�rcs)�releasez?Could not find past release for %s. Current known releases: %r.)�seriesz4Detected that apt lock is held. Sleeping 10 seconds.�
z9upgrade-lts-contract processing contract deltas: %s -> %sTF)r�past_entitlements�new_entitlements�allow_enable�series_overridesz/upgrade-lts-contract succeeded after %s retries)�LOG�debugr�is_attachedr�subp�printr�'RELEASE_UPGRADE_APT_LOCK_HELD_WILL_WAIT�get_release_infor�!current_codename_to_past_codename�get�RELEASE_UPGRADE_NO_PAST_RELEASE�format�warning�sys�exitr	�machine_token_file�entitlements�time�sleep�RELEASE_UPGRADE_STARTINGr�process_entitlements_delta�RELEASE_UPGRADE_SUCCESS)r�out�_err�current_release�past_releaserr�retry_counts        �?/usr/lib/python3/dist-packages/uaclient/upgrade_lts_contract.py�%process_contract_delta_after_apt_lockr:3s����I�I�5�6����(�(��	�	�H�I���I�I�.�/����V�%>�?�a��V�L�I�C��
�
�h�>�>�?��-�-�/�6�6�O�4�8�8��I�L���
��4�4�;�;�'�
<�
�	
�
	���M��-�	
�
	����� �������� ���������K�

��	�	�H�I��
�
�2���K�K�
�.�/�a��V�
�	��T�	�q�����I�I�C����

�(�
+�
+�,��'�'��+�)�����I�I�?��M�	�(�
*�
*�+�c�J�tjtj�y)N)r�ensure_folder_absentr�ESM_APT_ROOTDIR�r;r9�remove_private_esm_apt_cacher@ps��
���� 8� 8�9r;)�__doc__�loggingr+r/�uaclientrrrrr�(uaclient.api.u.pro.status.is_attached.v1r�uaclient.configr	r&�	getLogger�replace_top_level_logger_name�__name__rr:r@r?r;r9�<module>rIsx���.�
��?�?�A�$���
�
��
�
%�!��g���:��:�:�8�D�E��:,�x�:,�D�:,�z:r;

Zerion Mini Shell 1.0