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
This commit is contained in:
Ghanshyam Mann 2024-11-10 21:36:53 -08:00
parent 5c5e1063ed
commit e0199d5ddd
3 changed files with 1 additions and 14 deletions

View File

@ -27,7 +27,7 @@ oslo.concurrency>=4.1.0 # Apache-2.0
oslo.config>=8.1.0 # Apache-2.0 oslo.config>=8.1.0 # Apache-2.0
oslo.messaging>=14.1.0 # Apache-2.0 oslo.messaging>=14.1.0 # Apache-2.0
oslo.middleware>=4.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.privsep>=2.2.0 # Apache-2.0
oslo.serialization>=3.2.0 # Apache-2.0 oslo.serialization>=3.2.0 # Apache-2.0
oslo.service>=2.2.0 # Apache-2.0 oslo.service>=2.2.0 # Apache-2.0

View File

@ -16,7 +16,6 @@
# under the License. # under the License.
from oslo_middleware import cors from oslo_middleware import cors
from oslo_policy import opts
from zun.common import rpc from zun.common import rpc
import zun.conf import zun.conf
@ -40,11 +39,6 @@ def set_config_defaults():
"""This method updates all configuration default values.""" """This method updates all configuration default values."""
set_cors_middleware_defaults() 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(): def set_cors_middleware_defaults():
"""Update default configuration options for oslo.middleware.""" """Update default configuration options for oslo.middleware."""

View File

@ -16,7 +16,6 @@
"""Policy Engine For zun.""" """Policy Engine For zun."""
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 oslo_utils import excutils from oslo_utils import excutils
@ -28,12 +27,6 @@ _ENFORCER = None
CONF = zun.conf.CONF CONF = zun.conf.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)
# we can get a policy enforcer by this init. # we can get a policy enforcer by this init.
# oslo policy support change policy rule dynamically. # oslo policy support change policy rule dynamically.