From 3939ec35af1769b9f04e19b8b499ad4d37d51f1d Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Mon, 2 May 2022 12:47:16 +0200 Subject: [PATCH] Bump oslo.policy to 3.12.0 It allows us to revert temporary fix part from [1] as now InvalidScope exception is properly handled by oslo.policy. [1] https://review.opendev.org/c/openstack/neutron/+/826872 Related-bug: #1959333 Change-Id: I6b42306479c134ad8b07b8bf87d5c650fef9faae --- lower-constraints.txt | 2 +- neutron/policy.py | 17 ++++------------- requirements.txt | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index 6586d5a9dc9..044f49d66af 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -67,7 +67,7 @@ oslo.i18n==3.20.0 oslo.log==4.5.0 oslo.messaging==7.0.0 oslo.middleware==3.31.0 -oslo.policy==3.10.1 +oslo.policy==3.12.0 oslo.privsep==2.3.0 oslo.reports==1.18.0 oslo.rootwrap==5.15.0 diff --git a/neutron/policy.py b/neutron/policy.py index 29e14e4e04c..dca079b3c98 100644 --- a/neutron/policy.py +++ b/neutron/policy.py @@ -483,19 +483,10 @@ def check(context, action, target, plugin=None, might_not_exist=False, action, target, pluralized) - # TODO(slaweq): this try..except.. block can be removed when bug - # https://bugs.launchpad.net/oslo.policy/+bug/1965315 will be fixed in - # oslo.policy - try: - result = _ENFORCER.enforce(match_rule, - target, - credentials, - pluralized=pluralized) - except policy.InvalidScope: - log_rule_list(match_rule) - LOG.debug("Failed policy check for '%s'", action) - result = False - return result + return _ENFORCER.enforce(match_rule, + target, + credentials, + pluralized=pluralized) def enforce(context, action, target, plugin=None, pluralized=None): diff --git a/requirements.txt b/requirements.txt index cdb6c3c548d..74bb8995291 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,7 +33,7 @@ oslo.i18n>=3.20.0 # Apache-2.0 oslo.log>=4.5.0 # Apache-2.0 oslo.messaging>=7.0.0 # Apache-2.0 oslo.middleware>=3.31.0 # Apache-2.0 -oslo.policy>=3.10.1 # Apache-2.0 +oslo.policy>=3.12.0 # Apache-2.0 oslo.privsep>=2.3.0 # Apache-2.0 oslo.reports>=1.18.0 # Apache-2.0 oslo.rootwrap>=5.15.0 # Apache-2.0