diff options
author | Zuul <zuul@review.opendev.org> | 2021-08-25 05:58:30 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2021-08-25 05:58:30 +0000 |
commit | db26ba40b0ad5e25a5285e88495440adad3fe0ea (patch) | |
tree | 8d4161361d292fbaf20a83178da2023ccda41782 | |
parent | 9325d0cab27fb837cd7d7f27f058ed72dccc6b92 (diff) | |
parent | 714560436affa5efbe4b98cd5c8c17fd9ce79e7d (diff) | |
download | ironic-bugfix-18.0-eol.tar.gz |
Merge "Suppress policy deprecation and default change warnings" into bugfix/18.0bugfix-18.0-eol
-rw-r--r-- | ironic/common/policy.py | 7 | ||||
-rw-r--r-- | ironic/tests/unit/policy_fixture.py | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/ironic/common/policy.py b/ironic/common/policy.py index 1f5d9050c..2e493e9af 100644 --- a/ironic/common/policy.py +++ b/ironic/common/policy.py @@ -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()) diff --git a/ironic/tests/unit/policy_fixture.py b/ironic/tests/unit/policy_fixture.py index 4e07c2554..973c1e75e 100644 --- a/ironic/tests/unit/policy_fixture.py +++ b/ironic/tests/unit/policy_fixture.py @@ -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 |