From 04ff247ad03227ad7a53a3f86a66e2a88af0ce85 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Sun, 10 Nov 2024 21:38:01 -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: I48ca4c637689f6ad1a435c8e501efc438291257b --- keystone/common/rbac_enforcer/enforcer.py | 8 -------- keystone/conf/__init__.py | 7 ------- requirements.txt | 2 +- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/keystone/common/rbac_enforcer/enforcer.py b/keystone/common/rbac_enforcer/enforcer.py index 5d9489fb78..aa1b9cacda 100644 --- a/keystone/common/rbac_enforcer/enforcer.py +++ b/keystone/common/rbac_enforcer/enforcer.py @@ -14,7 +14,6 @@ import functools import flask from oslo_log import log -from oslo_policy import opts from oslo_policy import policy as common_policy from oslo_utils import strutils @@ -42,13 +41,6 @@ _POSSIBLE_TARGET_ACTIONS = frozenset( _ENFORCEMENT_CHECK_ATTR = 'keystone:RBAC:enforcement_called' -# 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 RBACEnforcer: """Enforce RBAC on API calls.""" diff --git a/keystone/conf/__init__.py b/keystone/conf/__init__.py index 53ece0e0cb..692a56f679 100644 --- a/keystone/conf/__init__.py +++ b/keystone/conf/__init__.py @@ -17,7 +17,6 @@ from oslo_config import cfg from oslo_log import log import oslo_messaging from oslo_middleware import cors -from oslo_policy import opts as policy_opts from osprofiler import opts as profiler from keystone.conf import application_credential @@ -164,12 +163,6 @@ def set_external_opts_defaults(): # configure OSprofiler options profiler.set_defaults(CONF, enabled=False, trace_sqlalchemy=False) - # 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' - policy_opts.set_defaults(cfg.CONF, DEFAULT_POLICY_FILE) - # Oslo.cache is always enabled by default for request-local caching # TODO(morganfainberg): Fix this to not use internal interface when # oslo.cache has proper interface to set defaults added. This is diff --git a/requirements.txt b/requirements.txt index 21c0bbe761..3b03fc21d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,7 +25,7 @@ oslo.db>=6.0.0 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0 oslo.log>=3.44.0 # Apache-2.0 oslo.middleware>=3.31.0 # Apache-2.0 -oslo.policy>=3.10.0 # Apache-2.0 +oslo.policy>=4.5.0 # Apache-2.0 oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0 oslo.upgradecheck>=1.3.0 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0