From c77423d8bdaf4dc671fab7912d49ec0321286ee2 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Tue, 28 Feb 2017 11:11:34 -0800 Subject: [PATCH] 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 --- .../tempest/lib/services/network/json/network_client.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/neutron_lbaas/tests/tempest/lib/services/network/json/network_client.py b/neutron_lbaas/tests/tempest/lib/services/network/json/network_client.py index 46f086d4d..b82cb4413 100644 --- a/neutron_lbaas/tests/tempest/lib/services/network/json/network_client.py +++ b/neutron_lbaas/tests/tempest/lib/services/network/json/network_client.py @@ -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)