Suppress policy default change warnings

As part of the new policy, 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].

[1]https://docs.openstack.org/nova/latest/configuration/config.html#oslo_policy.enforce_new_defaults

Change-Id: Ie6e33d80469b3f32459f10c59b32cad4b548cb86
This commit is contained in:
Ghanshyam Mann 2021-07-06 11:48:53 -05:00
parent 8404e9ac74
commit f975f56fdc
1 changed files with 7 additions and 0 deletions

View File

@ -36,6 +36,13 @@ class ConfigHook(hooks.PecanHook):
def __init__(self, conf):
self.conf = conf
self.enforcer = policy.Enforcer(conf, default_rule="default")
# NOTE(gmann): Explictly disable the warnings for policies
# changing their default check_str. With new RBAC policy
# 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.
self.enforcer.suppress_default_change_warnings = True
self.enforcer.register_defaults(policies.list_rules())
def before(self, state):