diff options
author | Mitya_Eremeev <mitossvyaz@mail.ru> | 2022-06-06 13:17:51 +0300 |
---|---|---|
committer | mitya-eremeev-2 <mitossvyaz@mail.ru> | 2023-03-03 08:08:01 +0000 |
commit | d80573c61254a2f8f371746bc678bd3b60f8a6a4 (patch) | |
tree | c386e01ceb4a84b9248c9baa7dfec177c0b46054 | |
parent | e7b9dd1f5ab10b447faba291ca0f89089aa46bcc (diff) | |
download | oslo-policy-d80573c61254a2f8f371746bc678bd3b60f8a6a4.tar.gz |
Fix deprecated rule logic if the rule was deleted in policy directory.
The bug scenario:
- define deprecated rule in policy folder
- start a service
- enforce policies
- remove the rule in policy folder
- enforce policies
New default is applied to the rule,
but new and old defaults should be applied
(OR logic)
The patch fixes it.
Closes-Bug: 1977549
Change-Id: If11fe2da1163d6d3f16d133aeb207a055cf30de4
-rw-r--r-- | oslo_policy/policy.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/oslo_policy/policy.py b/oslo_policy/policy.py index 445b1df..ea2ab53 100644 --- a/oslo_policy/policy.py +++ b/oslo_policy/policy.py @@ -664,6 +664,7 @@ class Enforcer(object): ) elif self.overwrite: self.rules = Rules(default_rule=self.default_rule) + self.file_rules = {} for path in existing_policy_dirs: self._walk_through_policy_directory( path, self._load_policy_file, True, False) |