From 656e71c1020168ddfb049087c1c299ef6521443a Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Sun, 10 Nov 2024 21:37:51 -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: Iaa414ee88325bd0aa8c6c135baf1712dd6b3c6a7 --- heat/common/config.py | 6 ------ heat/common/policy.py | 9 --------- requirements.txt | 2 +- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/heat/common/config.py b/heat/common/config.py index 9125fc960c..b3bd6b3eea 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -19,7 +19,6 @@ from oslo_config import cfg from oslo_db import options as oslo_db_ops from oslo_log import log as logging from oslo_middleware import cors -from oslo_policy import opts as policy_opts from osprofiler import opts as profiler from heat.common import exception @@ -612,9 +611,4 @@ def set_config_defaults(): 'DELETE', 'PATCH'] ) - # 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 - policy_opts.set_defaults(cfg.CONF, 'policy.yaml') - profiler.set_defaults(cfg.CONF) diff --git a/heat/common/policy.py b/heat/common/policy.py index fe26646f11..78eebf64fd 100644 --- a/heat/common/policy.py +++ b/heat/common/policy.py @@ -19,7 +19,6 @@ 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 @@ -34,14 +33,6 @@ LOG = logging.getLogger(__name__) DEFAULT_RULES = policy.Rules.from_dict({'default': '!'}) DEFAULT_RESOURCE_RULES = policy.Rules.from_dict({'default': '@'}) -# TODO(gmann): Remove setting the default value of config policy_file -# 'policy_file' once oslo_policy change its default value to what -# is overridden here. -DEFAULT_POLICY_FILE = 'policy.yaml' -opts.set_defaults( - CONF, - DEFAULT_POLICY_FILE) - ENFORCER = None diff --git a/requirements.txt b/requirements.txt index 7cbe2b1e60..5a6ed09724 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,7 @@ oslo.i18n>=3.20.0 # Apache-2.0 oslo.log>=4.3.0 # Apache-2.0 oslo.messaging>=14.1.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.reports>=1.18.0 # Apache-2.0 oslo.serialization>=2.25.0 # Apache-2.0 oslo.service>=1.24.0 # Apache-2.0