Add oslo_policy.InvalidScope exception to the api faults map

With enforcing scopes enabled in Neutron, oslo_policy can raise
InvalidScope exception while enforcing policy rules. So this exception
type should be handled in the same way as it is with
PolicyNotAuthorized. Otherwise neutron returns 500 if InvalidScope
exception was raised by the policy enforce.

Closes-Bug: #1959333
Change-Id: Iad1e2c9f797091d728d419c6b9dc67d861d4214a
This commit is contained in:
Slawek Kaplonski 2022-03-25 14:50:33 +01:00
parent 74d3765407
commit da2baf389c

View File

@ -25,4 +25,5 @@ FAULT_MAP = {
exceptions.NotAuthorized: webob.exc.HTTPForbidden,
netaddr.AddrFormatError: webob.exc.HTTPBadRequest,
policy.PolicyNotAuthorized: webob.exc.HTTPForbidden,
policy.InvalidScope: webob.exc.HTTPForbidden,
}