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: I4783f751c8ec775e862f378dc0b212a416198c38
This commit is contained in:
Ghanshyam Mann 2024-11-10 21:38:05 -08:00
parent 3483be483d
commit 0db9a32e70
4 changed files with 1 additions and 27 deletions

View File

@ -16,7 +16,6 @@
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_policy import opts
cli_opts = [ cli_opts = [
@ -91,18 +90,3 @@ CONF.register_opts(os_opts)
CONF.register_opts(api_opts) CONF.register_opts(api_opts)
CONF.register_opts(lease_opts) CONF.register_opts(lease_opts)
logging.register_options(cfg.CONF) logging.register_options(cfg.CONF)
def set_lib_defaults():
"""Update default value for configuration options from other namespace.
Example, oslo lib config options. This is needed for
config generator tool to pick these default value changes.
https://docs.openstack.org/oslo.config/latest/cli/
generator.html#modifying-defaults-from-other-namespaces
"""
# 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(CONF, 'policy.yaml')

View File

@ -19,7 +19,6 @@ import functools
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from oslo_policy import opts
from oslo_policy import policy from oslo_policy import policy
from blazar import context from blazar import context
@ -30,13 +29,6 @@ CONF = cfg.CONF
LOG = logging.getLogger(__name__) 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)
_ENFORCER = None _ENFORCER = None

View File

@ -22,7 +22,7 @@ oslo.i18n>=3.15.3 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0
oslo.messaging>=5.29.0 # Apache-2.0 oslo.messaging>=5.29.0 # Apache-2.0
oslo.middleware>=3.31.0 # Apache-2.0 oslo.middleware>=3.31.0 # Apache-2.0
oslo.policy>=3.6.0 # Apache-2.0 oslo.policy>=4.5.0 # Apache-2.0
oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0 oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
oslo.service>=1.34.0 # Apache-2.0 oslo.service>=1.34.0 # Apache-2.0
oslo.upgradecheck>=1.3.0 # Apache-2.0 oslo.upgradecheck>=1.3.0 # Apache-2.0

View File

@ -54,8 +54,6 @@ blazar.api.v2.controllers.extensions =
oslo.config.opts = oslo.config.opts =
blazar = blazar.opts:list_opts blazar = blazar.opts:list_opts
oslo.config.opts.defaults =
blazar = blazar.config:set_lib_defaults
oslo.policy.policies = oslo.policy.policies =
blazar = blazar.policies:list_rules blazar = blazar.policies:list_rules