From e0199d5ddd346da4c2bcfe760e56b27aaea07968 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Sun, 10 Nov 2024 21:36:53 -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: Icb8cee28ac8463550315df625199afef70ff5999 --- requirements.txt | 2 +- zun/common/config.py | 6 ------ zun/common/policy.py | 7 ------- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/requirements.txt b/requirements.txt index 54d6d61b5..3dc4d7c34 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,7 +27,7 @@ oslo.concurrency>=4.1.0 # Apache-2.0 oslo.config>=8.1.0 # Apache-2.0 oslo.messaging>=14.1.0 # Apache-2.0 oslo.middleware>=4.1.0 # Apache-2.0 -oslo.policy>=3.6.0 # Apache-2.0 +oslo.policy>=4.5.0 # Apache-2.0 oslo.privsep>=2.2.0 # Apache-2.0 oslo.serialization>=3.2.0 # Apache-2.0 oslo.service>=2.2.0 # Apache-2.0 diff --git a/zun/common/config.py b/zun/common/config.py index c0e555c91..5c1e2b3e5 100644 --- a/zun/common/config.py +++ b/zun/common/config.py @@ -16,7 +16,6 @@ # under the License. from oslo_middleware import cors -from oslo_policy import opts from zun.common import rpc import zun.conf @@ -40,11 +39,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(zun.conf.CONF, 'policy.yaml') - def set_cors_middleware_defaults(): """Update default configuration options for oslo.middleware.""" diff --git a/zun/common/policy.py b/zun/common/policy.py index acdc087d1..54014a163 100644 --- a/zun/common/policy.py +++ b/zun/common/policy.py @@ -16,7 +16,6 @@ """Policy Engine For zun.""" from oslo_log import log as logging -from oslo_policy import opts from oslo_policy import policy from oslo_utils import excutils @@ -28,12 +27,6 @@ _ENFORCER = None CONF = zun.conf.CONF LOG = logging.getLogger(__name__) -# 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) - # we can get a policy enforcer by this init. # oslo policy support change policy rule dynamically.