diff options
Diffstat (limited to 'oslo_policy/policy.py')
-rw-r--r-- | oslo_policy/policy.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/oslo_policy/policy.py b/oslo_policy/policy.py index dbb9443..a1a6f85 100644 --- a/oslo_policy/policy.py +++ b/oslo_policy/policy.py @@ -703,7 +703,10 @@ class Enforcer(object): # messages telling them stuff is going to change if they don't maintain # the policy manually or add infrastructure to their deployment to # support the new policy. - if (deprecated_rule.check_str != default.check_str + # If flag enforce_new_defaults is true then do not add OrCheck + # the old check_str and enforce only new defaults. + if (not self.conf.oslo_policy.enforce_new_defaults + and deprecated_rule.check_str != default.check_str and default.name not in self.file_rules): default.check = OrCheck([_parser.parse_rule(cs) for cs in |