Merge "Fix octavia-status with amphorav2"

This commit is contained in:
Zuul 2023-07-07 11:53:26 +00:00 committed by Gerrit Code Review
commit 27ecd093f3
3 changed files with 8 additions and 4 deletions

View File

@ -76,9 +76,8 @@ class Checks(upgradecheck.UpgradeCommands):
'section.')) 'section.'))
def _check_amphorav2(self): def _check_amphorav2(self):
default_provider_driver = CONF.api_settings.default_provider_driver
enabled_provider_drivers = CONF.api_settings.enabled_provider_drivers 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): constants.AMPHORAV2 in enabled_provider_drivers):
persistence = self._check_persistence() persistence = self._check_persistence()
if isinstance(persistence, upgradecheck.Result): if isinstance(persistence, upgradecheck.Result):

View File

@ -32,8 +32,8 @@ class TestUpgradeChecks(base.TestCase):
def test__check_amphorav2_not_enabled(self): def test__check_amphorav2_not_enabled(self):
self.conf = self.useFixture(oslo_fixture.Config(cfg.CONF)) self.conf = self.useFixture(oslo_fixture.Config(cfg.CONF))
self.conf.config(group='api_settings', self.conf.config(group='api_settings',
default_provider_driver=constants.AMPHORA, default_provider_driver='other_provider',
enabled_provider_drivers={constants.AMPHORA: "Test"}) enabled_provider_drivers={'other_provider': "Test"})
check_result = self.cmd._check_amphorav2() check_result = self.cmd._check_amphorav2()
self.assertEqual( self.assertEqual(
Code.SUCCESS, check_result.code) Code.SUCCESS, check_result.code)

View File

@ -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.