⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.30
Server IP:
45.79.8.107
Server:
Linux localhost 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.2-1ubuntu2.21
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
uaclient
/
__pycache__
/
View File Name :
upgrade_lts_contract.cpython-310.pyc
o f2 @ s d Z ddlZddlZddlZddlmZmZmZmZm Z ddl mZ ddlm Z ddlmZ ddd d ddd Zee eZde ddfddZdd 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)contractdefaultsmessagessystemutil)_is_attached)UAConfig)get_machine_token_filetrustyxenialbionicfocallunarjammy)r r r r manticnoblecfgreturnc C s> t d t| jst d d S t d tjddgddgd\}}|r*ttj t j }t| }t |}|d u rQttjj|d t d |t td |j|d}| }d}|r|t d td 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_entitlementsnew_entitlementsallow_enableseries_overridesz/upgrade-lts-contract succeeded after %s retries)LOGdebugr is_attachedr subpprintr 'RELEASE_UPGRADE_APT_LOCK_HELD_WILL_WAITget_release_infor r !current_codename_to_past_codenamegetRELEASE_UPGRADE_NO_PAST_RELEASEformatwarningsysexitentitlementstimesleepRELEASE_UPGRADE_STARTINGr process_entitlements_deltaRELEASE_UPGRADE_SUCCESS) r out_errcurrent_releasemachine_token_filepast_releaser r retry_count r8 ?/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_ROOTDIRr8 r8 r8 r9 remove_private_esm_apt_cachen s r= )__doc__loggingr* r- uaclientr r r r r (uaclient.api.u.pro.status.is_attached.v1r uaclient.configr uaclient.files.machine_tokenr r% getLoggerreplace_top_level_logger_name__name__r r: r= r8 r8 r8 r9
s$ :