Merge ~mitchburton/landscape-charm:main into landscape-charm:main

Proposed by Mitch Burton
Status: Merged
Approved by: Mitch Burton
Approved revision: 9c04fd146a3548e4d90f9fbbe6371047bf4563f0
Merged at revision: 9c04fd146a3548e4d90f9fbbe6371047bf4563f0
Proposed branch: ~mitchburton/landscape-charm:main
Merge into: landscape-charm:main
Diff against target: 14 lines (+2/-1)
1 file modified
src/ (+2/-1)
Reviewer Review Type Date Requested Status
Kevin Nasto Approve
Review via email:

Commit message

add explicit apt update to install event handler

Description of the change

this adds the arg `update_cache=True` to make sure apt update is run when installing packages.

Difficult to test to make sure this resolves LP: #2046264 but we will keep an eye on it on next release.

To post a comment you must log in.
Revision history for this message
Kevin Nasto (silverdrake11) wrote :


review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/ b/src/
2index db71ddf..3ef8671 100755
3--- a/src/
4+++ b/src/
5@@ -286,7 +286,8 @@ class LandscapeServerCharm(CharmBase):
6 apt.remove_package(["needrestart"])
7 # Add the Landscape Server PPA and install via apt.
8 check_call(["add-apt-repository", "-y", landscape_ppa])
9- apt.add_package(["landscape-server", "landscape-hashids"])
10+ # Explicitly ensure cache is up-to-date after adding the PPA.
11+ apt.add_package(["landscape-server", "landscape-hashids"], update_cache=True)
12 check_call(["apt-mark", "hold", "landscape-hashids"])
13 except (PackageNotFoundError, PackageError, CalledProcessError) as exc:
14 logger.error("Failed to install packages")


People subscribed via source and target branches

to all changes: