From c9c3901034fb4c22cb7a386c510e96c8da46e55a Mon Sep 17 00:00:00 2001 From: Gregory Thiemonge Date: Wed, 29 Mar 2023 04:05:08 -0400 Subject: [PATCH] Fix octavia-status with amphorav2 Change-Id: I59f1ed85383c078f505c654b1acf3e2a22d11faa (cherry picked from commit 1771f6acf9255e0ba80a8e5e68a8d1865daaae30) (cherry picked from commit e6e9f285ffb6ef736ba2ffe93af959b0cb32d6ec) (cherry picked from commit 22d616c5455a0847a9f7c608676f27a871c649b2) (cherry picked from commit 1f224a9fb9d02fe6f78627961eaa1f2d9f893651) --- octavia/cmd/status.py | 3 +-- octavia/tests/unit/cmd/test_status.py | 4 ++-- .../notes/fix-octavia-status-amphorav2-038fe77a2189b99f.yaml | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/fix-octavia-status-amphorav2-038fe77a2189b99f.yaml diff --git a/octavia/cmd/status.py b/octavia/cmd/status.py index f98d51dad4..e2877de360 100644 --- a/octavia/cmd/status.py +++ b/octavia/cmd/status.py @@ -77,9 +77,8 @@ class Checks(upgradecheck.UpgradeCommands): 'section.')) def _check_amphorav2(self): - default_provider_driver = CONF.api_settings.default_provider_driver enabled_provider_drivers = CONF.api_settings.enabled_provider_drivers - if (default_provider_driver == constants.AMPHORAV2 or + if (constants.AMPHORA in enabled_provider_drivers or constants.AMPHORAV2 in enabled_provider_drivers): persistence = self._check_persistence() if isinstance(persistence, upgradecheck.Result): diff --git a/octavia/tests/unit/cmd/test_status.py b/octavia/tests/unit/cmd/test_status.py index 94b39b6502..a74b5555f9 100644 --- a/octavia/tests/unit/cmd/test_status.py +++ b/octavia/tests/unit/cmd/test_status.py @@ -32,8 +32,8 @@ class TestUpgradeChecks(base.TestCase): def test__check_amphorav2_not_enabled(self): self.conf = self.useFixture(oslo_fixture.Config(cfg.CONF)) self.conf.config(group='api_settings', - default_provider_driver=constants.AMPHORA, - enabled_provider_drivers={constants.AMPHORA: "Test"}) + default_provider_driver='other_provider', + enabled_provider_drivers={'other_provider': "Test"}) check_result = self.cmd._check_amphorav2() self.assertEqual( Code.SUCCESS, check_result.code) diff --git a/releasenotes/notes/fix-octavia-status-amphorav2-038fe77a2189b99f.yaml b/releasenotes/notes/fix-octavia-status-amphorav2-038fe77a2189b99f.yaml new file mode 100644 index 0000000000..d20ffe5416 --- /dev/null +++ b/releasenotes/notes/fix-octavia-status-amphorav2-038fe77a2189b99f.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixed a bug in octavia-status which reported an incorrect status for the + *amphorav2* driver when using the default *amphora* alias.