Add Forbidden translation
I890498b2df6ae8d8f689537c8d6da1b5c06c2bd6 is trying to separate
Forbidden from Unauthorized in tempest-lib, but the gate tests
fails because some negative tests expect Unauthorized in Tempest
side. To avoid failures, this patch adds Forbidden translation
temporary.
Change-Id: Ic6b06a8cb4747a94259602e013306a7632fb1b45
diff --git a/tempest/common/service_client.py b/tempest/common/service_client.py
index 45a07f1..d2f67e3 100644
--- a/tempest/common/service_client.py
+++ b/tempest/common/service_client.py
@@ -83,6 +83,12 @@
raise exceptions.ServerFault(ex)
except lib_exceptions.UnexpectedResponseCode as ex:
raise exceptions.UnexpectedResponseCode(ex)
+ # TODO(oomichi): This is just a workaround for failing gate tests
+ # when separating Forbidden from Unauthorized in tempest-lib.
+ # We will need to remove this translation and replace negative tests
+ # with lib_exceptions.Forbidden in the future.
+ except lib_exceptions.Forbidden as ex:
+ raise exceptions.Unauthorized(ex)
class ResponseBody(dict):