From 8e708a76b72fa66234f0ef7fd722ae315eae1b12 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Tue, 4 Oct 2022 15:24:12 +0000 Subject: [PATCH] Ensure openstack-release package is correct after install hook The linked bug shows the install of the charm with openstack-origin set to zed. This happens because configure_installation_source() causes the openstack-release package to be installed *before* the zed cloud archive sources are configured into /etc/apt and an apt update done. This means that the openstack-release package says "yoga" despite the zed packages actually being installed. Then, on the config-changed hook, it sees that the installed version is showing as yoga and tries to do an upgrade. This fails, as the charm hasn't yet bootstrapped, and the charm tries to bootstrap after upgrading the packages. There's a few bugs here which are exposed, but the tactical fix is to force the openstack-release to match the installed packages. Closes-Bug: #1989538 Change-Id: Icaa2303d2dbbcfc883ea1cd44ce0a77af1ef7250 --- hooks/neutron_api_hooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hooks/neutron_api_hooks.py b/hooks/neutron_api_hooks.py index 91572b63..f2342b4a 100755 --- a/hooks/neutron_api_hooks.py +++ b/hooks/neutron_api_hooks.py @@ -226,6 +226,10 @@ def install(): add_source(config('extra-source'), config('extra-key')) status_set('maintenance', 'Installing apt packages') apt_update(fatal=True) + # (ajkavanagh) LP: #1989538 + # Tactical fix to force openstack-release to match the configured + # installation source; note that it comes after apt_update(). + apt_install(['openstack-release'], fatal=False, quiet=True) packages = determine_packages(openstack_origin) apt_install(packages, fatal=True)