From 2c33c74c8fb78ecfd61060663fb7b1a649fbd7d6 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Wed, 14 Sep 2022 16:27:57 +0100 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. Change-Id: I3f47daf6bda6b62ffe4152ede2709f802f0ab606 Closes-Bug: #1989538 --- hooks/keystone_hooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hooks/keystone_hooks.py b/hooks/keystone_hooks.py index 5227cca1..990343c5 100755 --- a/hooks/keystone_hooks.py +++ b/hooks/keystone_hooks.py @@ -186,6 +186,10 @@ def install(): configure_installation_source(config('openstack-origin')) status_set('maintenance', 'Installing apt packages') apt_update() + # (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) apt_install(determine_packages(), fatal=True) if snap_install_requested():