Merge "Suppress policy deprecation and default change warnings"
This commit is contained in:
commit
5ae4bb31ca
@ -1797,6 +1797,13 @@ def init_enforcer(policy_file=None, rules=None,
|
||||
rules=rules,
|
||||
default_rule=default_rule,
|
||||
use_conf=use_conf)
|
||||
# NOTE(melwitt): 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
|
||||
_ENFORCER.register_defaults(list_policies())
|
||||
|
||||
|
||||
|
@ -44,3 +44,7 @@ class PolicyFixture(fixtures.Fixture):
|
||||
CONF.set_override('policy_file', self.policy_file_name, 'oslo_policy')
|
||||
ironic_policy._ENFORCER = None
|
||||
self.addCleanup(ironic_policy.get_enforcer().clear)
|
||||
# NOTE(melwitt): Logging all the deprecation warning for every unit
|
||||
# test will overflow the log files. Suppress the deprecation warnings
|
||||
# for tests.
|
||||
ironic_policy._ENFORCER.suppress_deprecation_warnings = True
|
||||
|
Loading…
Reference in New Issue
Block a user