diff --git a/octavia/cmd/status.py b/octavia/cmd/status.py index 3b3af733be..eb9f5a8248 100644 --- a/octavia/cmd/status.py +++ b/octavia/cmd/status.py @@ -84,32 +84,8 @@ class Checks(upgradecheck.UpgradeCommands): return upgradecheck.Result(upgradecheck.Code.SUCCESS, _('AmphoraV2 provider is not enabled.')) - def _check_yaml_policy(self): - if CONF.oslo_policy.policy_file.lower().endswith('yaml'): - return upgradecheck.Result(upgradecheck.Code.SUCCESS, - _('The [oslo_policy] policy_file ' - 'setting is configured for YAML ' - 'policy file format.')) - if CONF.oslo_policy.policy_file.lower().endswith('json'): - return upgradecheck.Result( - upgradecheck.Code.WARNING, - _('The [oslo_policy] policy_file setting is configured for ' - 'JSON policy file format. JSON format policy files have ' - 'been deprecated by oslo policy. Please use the oslo policy ' - 'tool to convert your policy file to YAML format. See this ' - 'patch for more information: ' - 'https://review.opendev.org/733650')) - return upgradecheck.Result(upgradecheck.Code.FAILURE, - _('Unable to determine the [oslo_policy] ' - 'policy_file setting file format. ' - 'Please make sure your policy file is ' - 'in YAML format and has the suffix of ' - '.yaml for the filename. Oslo policy ' - 'has deprecated the JSON file format.')) - _upgrade_checks = ( (_('AmphoraV2 Check'), _check_amphorav2), - (_('YAML Policy File'), _check_yaml_policy), (_('Policy File JSON to YAML Migration'), (common_checks.check_policy_json, {'conf': CONF})), ) diff --git a/octavia/tests/unit/cmd/test_status.py b/octavia/tests/unit/cmd/test_status.py index a74b5555f9..644cbb12be 100644 --- a/octavia/tests/unit/cmd/test_status.py +++ b/octavia/tests/unit/cmd/test_status.py @@ -19,7 +19,6 @@ from oslo_upgradecheck.upgradecheck import Code from octavia.cmd import status from octavia.common import constants -from octavia.common import policy from octavia.tests.unit import base @@ -125,20 +124,3 @@ class TestUpgradeChecks(base.TestCase): check_result = self.cmd._check_amphorav2() self.assertEqual( Code.FAILURE, check_result.code) - - def test__check_yaml_policy(self): - self.conf = self.useFixture(oslo_fixture.Config(cfg.CONF)) - self.conf.conf(args=[], project='octavia') - policy.Policy() - - self.conf.config(group='oslo_policy', policy_file='test.yaml') - check_result = self.cmd._check_yaml_policy() - self.assertEqual(Code.SUCCESS, check_result.code) - - self.conf.config(group='oslo_policy', policy_file='test.json') - check_result = self.cmd._check_yaml_policy() - self.assertEqual(Code.WARNING, check_result.code) - - self.conf.config(group='oslo_policy', policy_file='test') - check_result = self.cmd._check_yaml_policy() - self.assertEqual(Code.FAILURE, check_result.code)