Merge "placement: ignore policy scope check failures if not enforcing scope"
This commit is contained in:
commit
61f854ff64
|
@ -81,6 +81,13 @@ def deploy(conf):
|
|||
if middleware:
|
||||
application = middleware(application)
|
||||
|
||||
# NOTE(mriedem): Ignore scope check UserWarnings from oslo.policy.
|
||||
if not conf.oslo_policy.enforce_scope:
|
||||
import warnings
|
||||
warnings.filterwarnings('ignore',
|
||||
message="Policy .* failed scope check",
|
||||
category=UserWarning)
|
||||
|
||||
return application
|
||||
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import os.path
|
|||
|
||||
from oslo_log import log as logging
|
||||
from oslo_middleware import cors
|
||||
from oslo_policy import opts as policy_opts
|
||||
from oslo_utils import importutils
|
||||
import pbr.version
|
||||
|
||||
|
@ -65,6 +66,10 @@ def _parse_args(argv, default_config_files):
|
|||
|
||||
_set_middleware_defaults()
|
||||
|
||||
# This is needed so we can check [oslo_policy]/enforce_scope in the
|
||||
# deploy module.
|
||||
policy_opts.set_defaults(conf.CONF)
|
||||
|
||||
conf.CONF(argv[1:], project='nova', version=version_info.version_string(),
|
||||
default_config_files=default_config_files)
|
||||
|
||||
|
|
Loading…
Reference in New Issue