From 6148ba90771778d8526f1c9b43c203e9610b4d1d Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Sun, 10 Nov 2024 21:37:21 -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: I0374be2b69020201d0aa8558dd07ca15dd438574 --- neutron/common/config.py | 6 ------ neutron/policy.py | 9 --------- requirements.txt | 2 +- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/neutron/common/config.py b/neutron/common/config.py index 65697dabc62..2a574226860 100644 --- a/neutron/common/config.py +++ b/neutron/common/config.py @@ -26,7 +26,6 @@ from oslo_config import cfg from oslo_log import log as logging import oslo_messaging from oslo_middleware import cors -from oslo_policy import opts from oslo_service import wsgi from neutron._i18n import _ @@ -150,11 +149,6 @@ def set_config_defaults(): """This method updates all configuration default values.""" set_cors_middleware_defaults() - # 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 - opts.set_defaults(cfg.CONF, policy.DEFAULT_POLICY_FILE) - def set_cors_middleware_defaults(): """Update default configuration options for oslo.middleware.""" diff --git a/neutron/policy.py b/neutron/policy.py index 64ed68d9005..34091f8be39 100644 --- a/neutron/policy.py +++ b/neutron/policy.py @@ -28,7 +28,6 @@ from neutron_lib.services import constants as service_const from oslo_config import cfg from oslo_db import exception as db_exc from oslo_log import log as logging -from oslo_policy import opts from oslo_policy import policy from oslo_utils import excutils import stevedore @@ -51,14 +50,6 @@ _RESOURCE_FOREIGN_KEYS = { 'security_groups': 'security_group_id' } -# TODO(slaweq): Remove overriding the default value of config options -# 'policy_file' once oslo_policy change its default value to what -# is overridden here. -DEFAULT_POLICY_FILE = 'policy.yaml' -opts.set_defaults( - cfg.CONF, - DEFAULT_POLICY_FILE) - def reset(): global _ENFORCER diff --git a/requirements.txt b/requirements.txt index f4a76583f42..539adaccf3c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -32,7 +32,7 @@ oslo.i18n>=3.20.0 # Apache-2.0 oslo.log>=5.3.0 # Apache-2.0 oslo.messaging>=7.0.0 # Apache-2.0 oslo.middleware>=3.31.0 # Apache-2.0 -oslo.policy>=4.4.0 # Apache-2.0 +oslo.policy>=4.5.0 # Apache-2.0 oslo.privsep>=2.3.0 # Apache-2.0 oslo.reports>=1.18.0 # Apache-2.0 oslo.rootwrap>=5.15.0 # Apache-2.0