summaryrefslogtreecommitdiff
path: root/oslo_policy/policy.py
diff options
context:
space:
mode:
authorLance Bragstad <lbragstad@gmail.com>2018-01-05 20:41:31 +0000
committerLance Bragstad <lbragstad@gmail.com>2018-01-05 21:00:16 +0000
commit4f68708a495fa2237b62491e355db99fac1f7edb (patch)
tree279e70416c3284401cb46f32beb7f5c998da728e /oslo_policy/policy.py
parent8835af6aa5b3c039b0c1b74a2b697fb654ae24dd (diff)
downloadoslo-policy-4f68708a495fa2237b62491e355db99fac1f7edb.tar.gz
Only log deprecation warnings when they are overridden1.33.1
The policy deprecation logic use to log a warning for operators that a policy was being removed regardless of the policy being overridden in a policy file somewhere. This can be somewhat noisy especially if there isn't anything for the operator to do since they haven't overridden the default. This commit changes the check to see if the deprecated policy is in the file_rules instead of just the registered rules. This means that operators should only see a deprecated for removal warning iff they are providing an override. Change-Id: Ia82516e9a13f6d04be2428b2a03883272be93329
Diffstat (limited to 'oslo_policy/policy.py')
-rw-r--r--oslo_policy/policy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/oslo_policy/policy.py b/oslo_policy/policy.py
index 6a7fc49..4034fff 100644
--- a/oslo_policy/policy.py
+++ b/oslo_policy/policy.py
@@ -608,7 +608,7 @@ class Enforcer(object):
)
warnings.warn(deprecated_msg)
if default.deprecated_for_removal and (
- default.name in self.rules):
+ default.name in self.file_rules):
# If a policy is going to be removed altogether, then we
# need to make sure we let operators know so they can clean
# up their policy files, if they are overriding it.