summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/policy_fixture.py
diff options
context:
space:
mode:
authormelanie witt <melwittt@gmail.com>2021-07-01 22:01:14 +0000
committermelanie witt <melwittt@gmail.com>2021-07-01 22:13:01 +0000
commit67ff5ff2b4ad4a12965142ffb1ff7fb11c07d337 (patch)
tree1e8580afbe01ef278c6ce585f2c2135b677c07f3 /ironic/tests/unit/policy_fixture.py
parent7c8ddbf747505964493092366904be9443ae1e1f (diff)
downloadironic-67ff5ff2b4ad4a12965142ffb1ff7fb11c07d337.tar.gz
Suppress policy deprecation and default change warnings
As part of the policy defaults refresh work, all of the defaults for policies were changed and warnings about it are being emitted constantly in the logs. We can suppress these for now until we are enforcing new defaults [1]. This also suppresses policy deprecation warnings during tests to avoid filling the console with warning messages. Related to blueprint policy-defaults-refresh [1]https://docs.openstack.org/nova/latest/configuration/config.html#oslo_policy.enforce_new_defaults Change-Id: I4a169b42d516a7ae2adcee9b69d71723fdefcd95
Diffstat (limited to 'ironic/tests/unit/policy_fixture.py')
-rw-r--r--ironic/tests/unit/policy_fixture.py4
1 files changed, 4 insertions, 0 deletions
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