0x1949 Team - FAZEMRX - MANAGER
Edit File: upgrade_lts_contract.cpython-310.pyc
o �(�f) � @ s� d Z ddlZddlZddlZddlmZmZmZmZm Z ddl mZ ddlm Z ddlmZ ddd d ddd �Ze�e �e��Zde ddfdd�Zdd� ZdS )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)� machine_token�trusty�xenial�bionic�focal�lunar�jammy)r r r r �mantic�noble�cfg�returnc C s@ t �d� t| �jst �d� d S t �d� tjddgddgd�\}}|r*ttj� t� � j }t�| �}t �|�}|d u rRttjj|d �� t �d |t � t�d� |j|d�}|�� }d}|r}t �d� t�d � tjddgddgd�\}}|d7 }|s`t �d||� ttj� tj| ||ddd� t �d|� ttj� d S )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 r �get_machine_token_file�!current_codename_to_past_codename�get�RELEASE_UPGRADE_NO_PAST_RELEASE�format�warning�sys�exit�entitlements�time�sleep�RELEASE_UPGRADE_STARTINGr �process_entitlements_delta�RELEASE_UPGRADE_SUCCESS) r �out�_err�current_release�machine_token_file�past_releaser r �retry_count� r9 �?/usr/lib/python3/dist-packages/uaclient/upgrade_lts_contract.py�%process_contract_delta_after_apt_lock4 sb ��� �� � �r; c C s t �tj� d S )N)r �ensure_folder_absentr �ESM_APT_ROOTDIRr9 r9 r9 r: �remove_private_esm_apt_cachen s r>