From 168e50108a66f0453b38d373d1508ee8bcfafbaa Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Thu, 4 Oct 2018 14:31:19 +0200 Subject: [PATCH] Fix raising TimeoutException in tests TimeoutException was imported from neutron_tempest_plugin.exceptions module but there is no such class there. This exception is defined in tempest.lib.exceptions module and this patch changes to use it from there properly. TrivialFix Change-Id: If32d8414207cdb9dd8016e8bb1f8ff47164ca1e4 --- neutron_tempest_plugin/scenario/test_floatingip.py | 2 +- .../services/network/json/network_client.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/neutron_tempest_plugin/scenario/test_floatingip.py b/neutron_tempest_plugin/scenario/test_floatingip.py index 19e843b9..38833cd4 100644 --- a/neutron_tempest_plugin/scenario/test_floatingip.py +++ b/neutron_tempest_plugin/scenario/test_floatingip.py @@ -21,6 +21,7 @@ from tempest.common import utils from tempest.common import waiters from tempest.lib.common.utils import data_utils from tempest.lib import decorators +from tempest.lib import exceptions import testscenarios from testscenarios.scenarios import multiply_scenarios @@ -28,7 +29,6 @@ from neutron_tempest_plugin.api import base as base_api from neutron_tempest_plugin.common import ssh from neutron_tempest_plugin.common import utils as common_utils from neutron_tempest_plugin import config -from neutron_tempest_plugin import exceptions from neutron_tempest_plugin.scenario import base from neutron_tempest_plugin.scenario import constants from neutron_tempest_plugin.scenario import test_qos diff --git a/neutron_tempest_plugin/services/network/json/network_client.py b/neutron_tempest_plugin/services/network/json/network_client.py index a28d6687..0d26a0e4 100644 --- a/neutron_tempest_plugin/services/network/json/network_client.py +++ b/neutron_tempest_plugin/services/network/json/network_client.py @@ -17,8 +17,6 @@ from six.moves.urllib import parse as urlparse from tempest.lib.common import rest_client as service_client from tempest.lib import exceptions as lib_exc -from neutron_tempest_plugin import exceptions - class NetworkClientJSON(service_client.RestClient): @@ -280,7 +278,7 @@ class NetworkClientJSON(service_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):