Skip to content

Commit

Permalink
Enable swift payload upgrades for wallaby+
Browse files Browse the repository at this point in the history
Sync charm-helpers to pick up fix for openstack_upgrade_available
that enables successful payload upgrades. This will need backporting
to stable/wallaby.

juju/charm-helpers#866
Closes-Bug: #2040606
Change-Id: I4b8ac52d31d2322d7dfa1700b452ed5b49ed303f
  • Loading branch information
Corey Bryant committed Nov 14, 2023
1 parent e9face7 commit 67eda9f
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions charmhelpers/contrib/openstack/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,6 @@ def get_os_version_codename(codename, version_map=OPENSTACK_CODENAMES,
error_out(e)


def get_os_version_codename_swift(codename):
'''Determine OpenStack version number of swift from codename.'''
# for k, v in six.iteritems(SWIFT_CODENAMES):
for k, v in SWIFT_CODENAMES.items():
if k == codename:
return v[-1]
e = 'Could not derive swift version for '\
'codename: %s' % codename
error_out(e)


def get_swift_codename(version):
'''Determine OpenStack codename that corresponds to swift version.'''
codenames = [k for k, v in SWIFT_CODENAMES.items() if version in v]
Expand Down Expand Up @@ -846,14 +835,10 @@ def openstack_upgrade_available(package):
if not cur_vers:
# The package has not been installed yet do not attempt upgrade
return False
if "swift" in package:
codename = get_os_codename_install_source(src)
avail_vers = get_os_version_codename_swift(codename)
else:
try:
avail_vers = get_os_version_install_source(src)
except Exception:
avail_vers = cur_vers
try:
avail_vers = get_os_version_install_source(src)
except Exception:
avail_vers = cur_vers
apt.init()
return apt.version_compare(avail_vers, cur_vers) >= 1

Expand Down

0 comments on commit 67eda9f

Please sign in to comment.