Use tempest.lib's TimeoutException

TimeoutException is defined in tempest.lib.exceptions like
https://github.com/openstack/tempest/blob/master/tempest/lib/exceptions.py#L139
Then this patch makes network_client use the exception.

Change-Id: I9b7a40e8cbcb239eb983c3418e5e2ea723a5b523
This commit is contained in:
Ken'ichi Ohmichi 2017-02-28 11:11:34 -08:00
parent 054423be12
commit c77423d8bd
1 changed files with 2 additions and 3 deletions

View File

@ -20,7 +20,6 @@ from six.moves.urllib import parse
from tempest.lib.common import rest_client
from tempest.lib.common.utils import test_utils
from tempest.lib import exceptions as lib_exc
from tempest import exceptions
class NetworkClientJSON(rest_client.RestClient):
@ -247,7 +246,7 @@ class NetworkClientJSON(rest_client.RestClient):
if self.is_resource_deleted(resource_type, id):
return
if int(time.time()) - start_time >= self.build_timeout:
raise exceptions.TimeoutException
raise lib_exc.TimeoutException
time.sleep(self.build_interval)
def is_resource_deleted(self, resource_type, id):
@ -295,7 +294,7 @@ class NetworkClientJSON(rest_client.RestClient):
caller = test_utils.find_test_caller()
if caller:
message = '(%s) %s' % (caller, message)
raise exceptions.TimeoutException(message)
raise lib_exc.TimeoutException(message)
def deserialize_single(self, body):
return json.loads(body)