Merge "Use oslo policy flag to disable default change warning instead of all"

This commit is contained in:
Zuul 2020-04-21 10:04:19 +00:00 committed by Gerrit Code Review
commit f1e448d672
3 changed files with 10 additions and 5 deletions

View File

@ -81,7 +81,7 @@ oslo.i18n==3.15.3
oslo.log==3.36.0
oslo.messaging==10.3.0
oslo.middleware==3.31.0
oslo.policy==2.3.0
oslo.policy==3.1.0
oslo.privsep==1.33.2
oslo.reports==1.18.0
oslo.rootwrap==5.8.0

View File

@ -49,10 +49,8 @@ def reset():
_ENFORCER = None
# TODO(gmann): Make suppress_deprecation_warnings default to False, once
# we find the way to disable warning for default change on oslo side.
def init(policy_file=None, rules=None, default_rule=None, use_conf=True,
suppress_deprecation_warnings=True):
suppress_deprecation_warnings=False):
"""Init an Enforcer class.
:param policy_file: Custom policy file to use, if none is specified,
@ -75,6 +73,13 @@ def init(policy_file=None, rules=None, default_rule=None, use_conf=True,
rules=rules,
default_rule=default_rule,
use_conf=use_conf)
# NOTE(gmann): Explictly disable the warnings for policies
# changing their default check_str. During policy-defaults-refresh
# work, all the policy defaults have been changed and warning for
# each policy started filling the logs limit for various tool.
# Once we move to new defaults only world then we can enable these
# warning again.
_ENFORCER.suppress_default_change_warnings = True
if suppress_deprecation_warnings:
_ENFORCER.suppress_deprecation_warnings = True
register_rules(_ENFORCER)

View File

@ -45,7 +45,7 @@ oslo.utils>=4.1.0 # Apache-2.0
oslo.db>=4.44.0 # Apache-2.0
oslo.rootwrap>=5.8.0 # Apache-2.0
oslo.messaging>=10.3.0 # Apache-2.0
oslo.policy>=2.3.0 # Apache-2.0
oslo.policy>=3.1.0 # Apache-2.0
oslo.privsep>=1.33.2 # Apache-2.0
oslo.i18n>=3.15.3 # Apache-2.0
oslo.service>=1.40.1 # Apache-2.0