From 2eefaeed140f0edbc6a1c42465f3f15998d30b9b Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Sun, 10 Nov 2024 21:36:55 -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: I46cc9e05fbc8f6c95c0b2d50093ecfb070a4170f --- requirements.txt | 2 +- watcher/common/policy.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0a91d505f..d7526ca42 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ oslo.db>=4.44.0 # Apache-2.0 oslo.i18n>=3.20.0 # Apache-2.0 oslo.log>=3.37.0 # Apache-2.0 oslo.messaging>=14.1.0 # Apache-2.0 -oslo.policy>=3.6.0 # Apache-2.0 +oslo.policy>=4.5.0 # Apache-2.0 oslo.reports>=1.27.0 # Apache-2.0 oslo.serialization>=2.25.0 # Apache-2.0 oslo.service>=1.30.0 # Apache-2.0 diff --git a/watcher/common/policy.py b/watcher/common/policy.py index 14f2b5cad..edab70c4c 100644 --- a/watcher/common/policy.py +++ b/watcher/common/policy.py @@ -18,7 +18,6 @@ import sys from oslo_config import cfg -from oslo_policy import opts from oslo_policy import policy from watcher.common import exception @@ -27,12 +26,6 @@ from watcher.common import policies _ENFORCER = None CONF = cfg.CONF -# 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.