From ce045b972322cbfa10ba422fbcbe86e8ed1d6bbc Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Sun, 10 Nov 2024 21:37:04 -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: I6e4c517eb81a50056563189753b21191bbf6b92d --- nova/config.py | 5 ----- nova/policy.py | 9 --------- requirements.txt | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/nova/config.py b/nova/config.py index 545fc5714591..c0fce224c3b2 100644 --- a/nova/config.py +++ b/nova/config.py @@ -18,14 +18,12 @@ import logging from oslo_log import log -from oslo_policy import opts as policy_opts from oslo_utils import importutils import nova.conf from nova.db.api import api as api_db_api from nova.db.main import api as main_db_api from nova import middleware -from nova import policy from nova import rpc from nova import version @@ -54,9 +52,6 @@ def set_lib_defaults(): # logging_context_format_string config option. set_log_defaults() - # Update default value of oslo.policy policy_file config option. - policy_opts.set_defaults(CONF, policy.DEFAULT_POLICY_FILE) - def rabbit_heartbeat_filter(log_record): message = "Unexpected error during heartbeat thread processing" diff --git a/nova/policy.py b/nova/policy.py index 18198eed6337..0d1ede0bef72 100644 --- a/nova/policy.py +++ b/nova/policy.py @@ -19,7 +19,6 @@ import re from oslo_config import cfg from oslo_log import log as logging -from oslo_policy import opts from oslo_policy import policy from oslo_utils import excutils @@ -41,14 +40,6 @@ USER_BASED_RESOURCES = ['os-keypairs'] saved_file_rules = [] KEY_EXPR = re.compile(r'%\((\w+)\)s') -# TODO(gmann): 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 36d5026fec89..556a32142211 100644 --- a/requirements.txt +++ b/requirements.txt @@ -42,7 +42,7 @@ oslo.utils>=7.3.0 # Apache-2.0 oslo.db>=10.0.0 # Apache-2.0 oslo.rootwrap>=5.15.0 # Apache-2.0 oslo.messaging>=14.1.0 # Apache-2.0 -oslo.policy>=4.4.0 # Apache-2.0 +oslo.policy>=4.5.0 # Apache-2.0 oslo.privsep>=2.6.2 # Apache-2.0 oslo.i18n>=5.1.0 # Apache-2.0 oslo.service>=2.8.0 # Apache-2.0