summaryrefslogtreecommitdiff
path: root/oslo_policy/policy.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_policy/policy.py')
-rw-r--r--oslo_policy/policy.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/oslo_policy/policy.py b/oslo_policy/policy.py
index 61a3597..b019315 100644
--- a/oslo_policy/policy.py
+++ b/oslo_policy/policy.py
@@ -696,7 +696,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