Merge ~lamoura/ubuntu/+source/ubuntu-advantage-tools:upload-27.13.1-lunar into ubuntu/+source/ubuntu-advantage-tools:ubuntu/devel

Proposed by Lucas Albuquerque Medeiros de Moura
Status: Merged
Merged at revision: 190cb95c878c080181b3fe07fff94605bfbaa008
Proposed branch: ~lamoura/ubuntu/+source/ubuntu-advantage-tools:upload-27.13.1-lunar
Merge into: ubuntu/+source/ubuntu-advantage-tools:ubuntu/devel
Diff against target: 71 lines (+21/-1)
4 files modified
debian/changelog (+7/-0)
uaclient/apt.py (+9/-0)
uaclient/tests/test_apt.py (+4/-0)
uaclient/version.py (+1/-1)
Reviewer Review Type Date Requested Status
Paride Legovini (community) Approve
Canonical Server Pending
Review via email: mp+436192@code.launchpad.net

Description of the change

Pro release for SRU:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/2003018

With a better isolated esm apt setup

To post a comment you must log in.
Revision history for this message
Paride Legovini (paride) wrote :

LGTM and should address the issue Andreas raised in his comment to the SRU bug.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index bf2df4b..519bdf0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1ubuntu-advantage-tools (27.13.1~23.04.1) lunar; urgency=medium
2
3 * apt: better isolate apt esm cache by only fetching necessary
4 configuration from the system apt
5
6 -- Lucas Moura <lucas.moura@canonical.com> Mon, 23 Jan 2023 11:54:06 -0300
7
1ubuntu-advantage-tools (27.13~23.04.1) lunar; urgency=medium8ubuntu-advantage-tools (27.13~23.04.1) lunar; urgency=medium
29
3 * d/bash-completion:10 * d/bash-completion:
diff --git a/uaclient/apt.py b/uaclient/apt.py
index e98a637..15e9368 100644
--- a/uaclient/apt.py
+++ b/uaclient/apt.py
@@ -603,6 +603,7 @@ def update_esm_caches(cfg) -> None:
603 return603 return
604604
605 import apt # type: ignore605 import apt # type: ignore
606 import apt_pkg # type: ignore
606607
607 from uaclient.entitlements.entitlement_status import ApplicationStatus608 from uaclient.entitlements.entitlement_status import ApplicationStatus
608 from uaclient.entitlements.esm import (609 from uaclient.entitlements.esm import (
@@ -623,5 +624,13 @@ def update_esm_caches(cfg) -> None:
623 infra.setup_local_esm_repo()624 infra.setup_local_esm_repo()
624625
625 # Read the cache and update it626 # Read the cache and update it
627 # Take care to initialize the cache with only the
628 # Acquire configuration preserved
629 for key in apt_pkg.config.keys():
630 if "Acquire" not in key:
631 apt_pkg.config.clear(key)
632 apt_pkg.config.set("Dir", ESM_APT_ROOTDIR)
633 apt_pkg.init_config()
634
626 cache = apt.Cache(rootdir=ESM_APT_ROOTDIR)635 cache = apt.Cache(rootdir=ESM_APT_ROOTDIR)
627 cache.update()636 cache.update()
diff --git a/uaclient/tests/test_apt.py b/uaclient/tests/test_apt.py
index 9dc3829..087a3cf 100644
--- a/uaclient/tests/test_apt.py
+++ b/uaclient/tests/test_apt.py
@@ -1087,8 +1087,12 @@ class TestAptCacheTime:
1087 @mock.patch("uaclient.apt.system.is_current_series_lts")1087 @mock.patch("uaclient.apt.system.is_current_series_lts")
1088 @mock.patch("uaclient.apt.system.is_current_series_active_esm")1088 @mock.patch("uaclient.apt.system.is_current_series_active_esm")
1089 @mock.patch("apt.Cache")1089 @mock.patch("apt.Cache")
1090 @mock.patch("apt_pkg.config")
1091 @mock.patch("apt_pkg.init_config")
1090 def test_update_esm_caches_based_on_lts(1092 def test_update_esm_caches_based_on_lts(
1091 self,1093 self,
1094 _m_apt_pkg_init_config,
1095 _m_apt_pkg_config,
1092 m_cache,1096 m_cache,
1093 m_is_esm,1097 m_is_esm,
1094 m_is_lts,1098 m_is_lts,
diff --git a/uaclient/version.py b/uaclient/version.py
index b87f757..6d14ab2 100644
--- a/uaclient/version.py
+++ b/uaclient/version.py
@@ -15,7 +15,7 @@ from uaclient.defaults import CANDIDATE_CACHE_PATH, UAC_RUN_PATH
15from uaclient.exceptions import ProcessExecutionError15from uaclient.exceptions import ProcessExecutionError
16from uaclient.system import subp16from uaclient.system import subp
1717
18__VERSION__ = "27.13"18__VERSION__ = "27.13.1"
19PACKAGED_VERSION = "@@PACKAGED_VERSION@@"19PACKAGED_VERSION = "@@PACKAGED_VERSION@@"
2020
21CANDIDATE_REGEX = r"Candidate: (?P<candidate>.*?)\n"21CANDIDATE_REGEX = r"Candidate: (?P<candidate>.*?)\n"

Subscribers

People subscribed via source and target branches

to status/vote changes: