From 4355ea2d6b1cc47dc530c2dc83c0d87db7881bed Mon Sep 17 00:00:00 2001 From: Hemanth Nakkina Date: Tue, 30 Nov 2021 12:41:54 +0530 Subject: [PATCH] Remove neutron-fwaas-dashboard package for >= V neutron-fwaas project is retired from Victoria release. This patch removes installing neutron-fwaas-dashboard package from Victoria release onwards. Closes-Bug: 1934129 Change-Id: Id2c8695274bb3438612ee44bb922766a6bddf900 --- hooks/horizon_utils.py | 4 ++++ unit_tests/test_horizon_utils.py | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/hooks/horizon_utils.py b/hooks/horizon_utils.py index dd02e32d..c5163c39 100644 --- a/hooks/horizon_utils.py +++ b/hooks/horizon_utils.py @@ -509,6 +509,8 @@ def determine_packages(): packages = set(packages) if release >= 'train': packages.remove('python3-neutron-lbaas-dashboard') + if release >= 'victoria': + packages.remove('python3-neutron-fwaas-dashboard') # NOTE(ajkavanagh) - don't reinstall packages (e.g. on upgrade) that # plugins have already indicated should not be installed as they clash with # the plugin. Do add in any packages that the plugins want. Note that @@ -566,6 +568,8 @@ def determine_purge_packages(): ]) if release >= 'train': pkgs.append('python3-neutron-lbaas-dashboard') + if release >= 'victoria': + pkgs.append('python3-neutron-fwaas-dashboard') # NOTE(ajkavanagh) also ensure that associated plugins can purge on upgrade return list(set(pkgs) .union(set(determine_purge_packages_dashboard_plugin()))) diff --git a/unit_tests/test_horizon_utils.py b/unit_tests/test_horizon_utils.py index 8e81e28a..8eac76a4 100644 --- a/unit_tests/test_horizon_utils.py +++ b/unit_tests/test_horizon_utils.py @@ -86,6 +86,21 @@ class TestHorizonUtils(CharmTestCase): horizon_utils.PY3_PACKAGES) ) + def test_determine_packages_victoria(self): + horizon_utils.os_release.return_value = 'victoria' + verify_pkgs = [ + p for p in horizon_utils.BASE_PACKAGES + if not p.startswith('python-') + ] + horizon_utils.PY3_PACKAGES + verify_pkgs.append('python3-mysqldb') + verify_pkgs.remove('python3-neutron-lbaas-dashboard') + verify_pkgs.remove('python3-neutron-fwaas-dashboard') + + self.assertEqual( + sorted(horizon_utils.determine_packages()), + sorted(verify_pkgs) + ) + def test_determine_purge_packages(self): 'Ensure no packages are identified for purge prior to rocky' horizon_utils.os_release.return_value = 'queens' @@ -109,6 +124,25 @@ class TestHorizonUtils(CharmTestCase): sorted(horizon_utils.determine_purge_packages()), sorted(verify_pkgs)) + def test_determine_purge_packages_victoria(self): + 'Ensure python packages are identified for purge at victoria' + horizon_utils.relation_ids.return_value = [] + horizon_utils.os_release.return_value = 'victoria' + verify_pkgs = ( + [p for p in horizon_utils.BASE_PACKAGES + if p.startswith('python-')] + + ['python-django-horizon', + 'python-django-openstack-auth', + 'python-pymysql', + 'python-neutron-lbaas-dashboard', + 'python-designate-dashboard', + 'python-heat-dashboard', + 'python3-neutron-lbaas-dashboard', + 'python3-neutron-fwaas-dashboard']) + self.assertEqual( + sorted(horizon_utils.determine_purge_packages()), + sorted(verify_pkgs)) + def _patch_for_dashboard_plugin_packages(self): def relation_ids_side_effect(rname):