From bd53b0ec84425dbde06243a4dffce9b57437d5c4 Mon Sep 17 00:00:00 2001 From: mpanduru <101260894+mpanduru@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:03:13 +0200 Subject: [PATCH] Drop use of SWIFT_CODENAMES when determining currently installed Swift version Since the SWIFT_CODENAMES and PACKAGE_CODENAMES are not maintained as of Wallaby, the currently installed version of Swift should be determined similarly to how it is done for other OpenStack packages: by identifying the current release using the openstack-release package. The current approach causes Swift upgrades from source versions subsequent to Victoria to fail to be detected. Fixes: #914 --- charmhelpers/contrib/openstack/utils.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/charmhelpers/contrib/openstack/utils.py b/charmhelpers/contrib/openstack/utils.py index ac52d797b..6180a52a0 100644 --- a/charmhelpers/contrib/openstack/utils.py +++ b/charmhelpers/contrib/openstack/utils.py @@ -545,16 +545,10 @@ def get_os_version_package(pkg, fatal=True): if not codename: return None - if 'swift' in pkg: - vers_map = SWIFT_CODENAMES - for cname, version in vers_map.items(): - if cname == codename: - return version[-1] - else: - vers_map = OPENSTACK_CODENAMES - for version, cname in vers_map.items(): - if cname == codename: - return version + vers_map = OPENSTACK_CODENAMES + for version, cname in vers_map.items(): + if cname == codename: + return version def get_installed_os_version():