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
This commit is contained in:
Masayuki Igawa 2015-01-20 14:35:20 +09:00
parent 9a77c920a2
commit dd7590832a
5 changed files with 9 additions and 9 deletions

View File

@ -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 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
# 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)

View File

@ -71,8 +71,6 @@ class ServiceClient(rest_client.RestClient):
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

View File

@ -163,10 +163,6 @@ class BadRequest(RestClientException):
message = "Bad request"
class UnprocessableEntity(RestClientException):
message = "Unprocessable entity"
class OverLimit(RestClientException):
message = "Quota exceeded"

View File

@ -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 @@ class BaseVolumeTypesClientJSON(base.VolumeClient):
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

View File

@ -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 @@ class BaseQosSpecsClientJSON(base.VolumeClient):
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