Change tempest UnprocessableEntity exc to tempest-lib exc
This commit changes tempest.exceptions.UnprocessableEntity to
tempest_lib.exceptions.UnprocessableEntity. This is one of the migrating
rest client to tempest-lib works.
Change-Id: I7293131d2961388b91b3270167a07496a8a0f378
diff --git a/tempest/api/compute/floating_ips/test_floating_ips_actions.py b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
index 19f5fba..e6f4fb0 100644
--- a/tempest/api/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/api/compute/floating_ips/test_floating_ips_actions.py
@@ -13,6 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+from tempest_lib import exceptions as lib_exc
+
from tempest.api.compute.floating_ips import base
from tempest.common.utils import data_utils
from tempest import exceptions
@@ -135,7 +137,7 @@
# Make sure no longer associated with old server
self.assertRaises((exceptions.NotFound,
- exceptions.UnprocessableEntity,
+ lib_exc.UnprocessableEntity,
exceptions.Conflict),
self.client.disassociate_floating_ip_from_server,
self.floating_ip, self.server_id)
diff --git a/tempest/common/service_client.py b/tempest/common/service_client.py
index dc634a1..513098e 100644
--- a/tempest/common/service_client.py
+++ b/tempest/common/service_client.py
@@ -71,8 +71,6 @@
raise exceptions.OverLimit(ex)
except lib_exceptions.InvalidContentType as ex:
raise exceptions.InvalidContentType(ex)
- except lib_exceptions.UnprocessableEntity as ex:
- raise exceptions.UnprocessableEntity(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
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index 680b92a..3b5fedb 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -163,10 +163,6 @@
message = "Bad request"
-class UnprocessableEntity(RestClientException):
- message = "Unprocessable entity"
-
-
class OverLimit(RestClientException):
message = "Quota exceeded"
diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py
index b3b4ae6..fe85ac4 100644
--- a/tempest/services/volume/json/admin/volume_types_client.py
+++ b/tempest/services/volume/json/admin/volume_types_client.py
@@ -16,6 +16,8 @@
import json
import urllib
+from tempest_lib import exceptions as lib_exc
+
from tempest.common import service_client
from tempest import exceptions
from tempest.services.volume.json import base
@@ -40,7 +42,7 @@
return True
else:
msg = (" resource value is either not defined or incorrect.")
- raise exceptions.UnprocessableEntity(msg)
+ raise lib_exc.UnprocessableEntity(msg)
except exceptions.NotFound:
return True
return False
diff --git a/tempest/services/volume/json/qos_client.py b/tempest/services/volume/json/qos_client.py
index 32555eb..a2449d2 100644
--- a/tempest/services/volume/json/qos_client.py
+++ b/tempest/services/volume/json/qos_client.py
@@ -15,6 +15,8 @@
import json
import time
+from tempest_lib import exceptions as lib_exc
+
from tempest.common import service_client
from tempest import exceptions
from tempest.services.volume.json import base
@@ -60,7 +62,7 @@
return
else:
msg = (" operation value is either not defined or incorrect.")
- raise exceptions.UnprocessableEntity(msg)
+ raise lib_exc.UnprocessableEntity(msg)
if int(time.time()) - start_time >= self.build_timeout:
raise exceptions.TimeoutException