From c24e2cf4230550741ab057eb891e9b12d6741b64 Mon Sep 17 00:00:00 2001 From: James Page Date: Wed, 23 Jan 2019 16:59:28 +0000 Subject: [PATCH] upgrade: preserve glance-registry for Queens The glance-registry daemon was deprecated at Queens, but was still installed for the Queens charm release; ensure that any re-install of paste.ini files accomodates this as part of the charm upgrade process, resolving issues with glance-registry not running due to missing paste configuration files. Change-Id: Iaaea4907ce4ef9d1e17b8ef9719e8bb0e0001946 Closes-Bug: 1812972 --- hooks/glance_utils.py | 7 +++---- unit_tests/test_glance_utils.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hooks/glance_utils.py b/hooks/glance_utils.py index 6215d068..e6a47bdc 100644 --- a/hooks/glance_utils.py +++ b/hooks/glance_utils.py @@ -531,11 +531,10 @@ def reinstall_paste_ini(force_reinstall=False): if os.path.exists(paste_file): os.remove(paste_file) cmp_release = CompareOpenStackReleases(os_release('glance-common')) - if cmp_release < 'queens': + # glance-registry is deprecated at queens but still + # installed. + if cmp_release < 'rocky': pkg_list = ['glance-api', 'glance-registry'] - # glance-registry is deprecated in Queens - elif cmp_release < 'rocky': - pkg_list = ['glance-api'] # File is in glance-common for py3 packages. else: pkg_list = ['glance-common'] diff --git a/unit_tests/test_glance_utils.py b/unit_tests/test_glance_utils.py index 77f2d26f..81c969f8 100644 --- a/unit_tests/test_glance_utils.py +++ b/unit_tests/test_glance_utils.py @@ -314,7 +314,7 @@ class TestGlanceUtils(CharmTestCase): utils.reinstall_paste_ini() self.apt_install.assert_called_with( - packages=['glance-api'], + packages=['glance-api', 'glance-registry'], options=utils.REINSTALL_OPTIONS, fatal=True )