Fix osc-lib interface change: catch osc-lib Forbidden

The patch https://review.opendev.org/#/c/673389/
introduced a regression by changing the osc-lib
interface.

The patch
https://review.opendev.org/683119
changes the exception from the generic CommandError
back to a specific Forbidden exception.

This patch catches this exception and passes on, i.e.
re-implements the same behavior as before.

Story: 2006547

Change-Id: I17b1ec7abaa5b0828ccbcad40bd928565c5c59fb
Signed-off-by: Andreas Florath <Andreas.Florath@telekom.de>
This commit is contained in:
Andreas Florath 2019-09-19 11:44:14 +00:00
parent aa64eb6b0a
commit 9ad3439689
1 changed files with 1 additions and 1 deletions

View File

@ -207,7 +207,7 @@ def _find_identity_resource(identity_client_manager, name_or_id,
name_or_id, **kwargs)
if identity_resource is not None:
return identity_resource
except identity_exc.Forbidden:
except exceptions.Forbidden:
pass
return resource_type(None, {'id': name_or_id, 'name': name_or_id})