From 29852a21c561bc0ef113db8002a4a272ab534b27 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Sun, 10 Nov 2024 21:36:58 -0800 Subject: [PATCH] Remove default override for config options policy_file olso.policy 4.5.0[1] changed the config options policy_file default value to 'policy.yaml', which means it is changed for all the OpenStack services and they do not need to override the default anymore. NOTE: There is no change in behaviour here, oslo.policy provides the same configuration that services have overridden till now. [1] https://review.opendev.org/c/openstack/releases/+/934012 [2] https://review.opendev.org/c/openstack/requirements/+/934295 Change-Id: I15539e313a952da7ddea716a95222dadb3d31aa6 --- requirements.txt | 2 +- vitrage/api/hooks.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3aa8c6bdf..1a7e7c975 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ oslo.messaging>=5.36.0 # Apache-2.0 oslo.middleware>=3.35.0 # Apache-2.0 oslo.serialization>=2.25.0 # Apache-2.0 oslo.log>=3.44.0 # Apache-2.0 -oslo.policy>=3.6.0 # Apache-2.0 +oslo.policy>=4.5.0 # Apache-2.0 oslo.i18n>=3.20.0 # Apache-2.0 oslo.upgradecheck>=1.3.0 # Apache-2.0 pecan>=1.2.1 # BSD diff --git a/vitrage/api/hooks.py b/vitrage/api/hooks.py index e9044e261..a70fe25fa 100644 --- a/vitrage/api/hooks.py +++ b/vitrage/api/hooks.py @@ -14,7 +14,6 @@ import oslo_messaging from oslo_config import cfg from oslo_context import context -from oslo_policy import opts from oslo_policy import policy from pecan import hooks @@ -26,12 +25,6 @@ from vitrage import storage CONF = cfg.CONF -# TODO(gmann): Remove setting the default value of config policy_file -# once oslo_policy change the default value to 'policy.yaml'. -# https://github.com/openstack/oslo.policy/blob/a626ad12fe5a3abd49d70e3e5b95589d279ab578/oslo_policy/opts.py#L49 -DEFAULT_POLICY_FILE = 'policy.yaml' -opts.set_defaults(CONF, DEFAULT_POLICY_FILE) - class ConfigHook(hooks.PecanHook): """Attach the configuration and policy enforcer object to the request. """