Delete TimeoutException in tempest/exceptions.py
Delete TimeoutException in tempest/exceptions.py because it repeats in tempest/lib.exceptions.py Change-Id: I4242d8156dcba7d8e893975de62c82547625afbc
This commit is contained in:
parent
56a742a408
commit
ebb15f265e
@ -15,7 +15,7 @@
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from tempest.api.baremetal.admin import base
|
||||
from tempest import exceptions
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
|
||||
|
@ -20,7 +20,6 @@ from tempest.common import compute
|
||||
from tempest.common.utils import net_utils
|
||||
from tempest.common import waiters
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.lib import decorators
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
from tempest import test
|
||||
@ -71,7 +70,7 @@ class AttachInterfacesTestJSON(base.BaseV2ComputeTest):
|
||||
'(current %s) within the required time (%s s).' %
|
||||
(port_id, status, interface_status,
|
||||
self.build_timeout))
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
|
||||
return body
|
||||
|
||||
@ -99,7 +98,7 @@ class AttachInterfacesTestJSON(base.BaseV2ComputeTest):
|
||||
message = ('Port %s failed to detach (device_id %s) within '
|
||||
'the required time (%s s).' %
|
||||
(port_id, device_id, self.build_timeout))
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
|
||||
return port
|
||||
|
||||
@ -197,7 +196,7 @@ class AttachInterfacesTestJSON(base.BaseV2ComputeTest):
|
||||
if len(ifs) == len(_ifs) and timed_out:
|
||||
message = ('Failed to delete interface within '
|
||||
'the required time: %s sec.' % self.build_timeout)
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
|
||||
self.assertNotIn(iface['port_id'], [i['port_id'] for i in _ifs])
|
||||
return _ifs
|
||||
|
@ -18,7 +18,7 @@ import netaddr
|
||||
from tempest.api.orchestration import base
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.lib import exceptions
|
||||
from tempest import test
|
||||
|
||||
CONF = config.CONF
|
||||
|
@ -92,7 +92,7 @@ def wait_for_server_status(client, server_id, status, ready_wait=True,
|
||||
caller = test_utils.find_test_caller()
|
||||
if caller:
|
||||
message = '(%s) %s' % (caller, message)
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
old_status = server_status
|
||||
old_task_state = task_state
|
||||
|
||||
@ -111,7 +111,7 @@ def wait_for_server_termination(client, server_id, ignore_error=False):
|
||||
raise exceptions.BuildErrorException(server_id=server_id)
|
||||
|
||||
if int(time.time()) - start_time >= client.build_timeout:
|
||||
raise exceptions.TimeoutException
|
||||
raise lib_exc.TimeoutException
|
||||
|
||||
time.sleep(client.build_interval)
|
||||
|
||||
@ -163,7 +163,7 @@ def wait_for_image_status(client, image_id, status):
|
||||
caller = test_utils.find_test_caller()
|
||||
if caller:
|
||||
message = '(%s) %s' % (caller, message)
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
|
||||
|
||||
def wait_for_volume_status(client, volume_id, status):
|
||||
@ -186,7 +186,7 @@ def wait_for_volume_status(client, volume_id, status):
|
||||
'within the required time (%s s).' %
|
||||
(volume_id, status, volume_status,
|
||||
client.build_timeout))
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
|
||||
|
||||
def wait_for_snapshot_status(client, snapshot_id, status):
|
||||
@ -207,7 +207,7 @@ def wait_for_snapshot_status(client, snapshot_id, status):
|
||||
'within the required time (%s s).' %
|
||||
(snapshot_id, status, snapshot_status,
|
||||
client.build_timeout))
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
|
||||
|
||||
def wait_for_backup_status(client, backup_id, status):
|
||||
@ -228,7 +228,7 @@ def wait_for_backup_status(client, backup_id, status):
|
||||
'(current %s) within the required time (%s s).' %
|
||||
(backup_id, status, backup_status,
|
||||
client.build_timeout))
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
|
||||
|
||||
def wait_for_bm_node_status(client, node_id, attr, status):
|
||||
@ -257,7 +257,7 @@ def wait_for_bm_node_status(client, node_id, attr, status):
|
||||
caller = test_utils.find_test_caller()
|
||||
if caller:
|
||||
message = '(%s) %s' % (caller, message)
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
|
||||
|
||||
def wait_for_qos_operations(client, qos_id, operation, args=None):
|
||||
@ -288,5 +288,5 @@ def wait_for_qos_operations(client, qos_id, operation, args=None):
|
||||
raise lib_exc.UnprocessableEntity(msg)
|
||||
|
||||
if int(time.time()) - start_time >= client.build_timeout:
|
||||
raise exceptions.TimeoutException
|
||||
raise lib_exc.TimeoutException
|
||||
time.sleep(client.build_interval)
|
||||
|
@ -21,10 +21,6 @@ class InvalidServiceTag(exceptions.TempestException):
|
||||
message = "Invalid service tag"
|
||||
|
||||
|
||||
class TimeoutException(exceptions.TempestException):
|
||||
message = "Request timed out"
|
||||
|
||||
|
||||
class BuildErrorException(exceptions.TempestException):
|
||||
message = "Server %(server_id)s failed to build and is in ERROR status"
|
||||
|
||||
|
@ -1273,7 +1273,7 @@ class BaremetalScenarioTest(ScenarioTest):
|
||||
check_state, timeout, interval):
|
||||
msg = ("Timed out waiting for node %s to reach %s state(s) %s" %
|
||||
(node_id, state_attr, target_states))
|
||||
raise exceptions.TimeoutException(msg)
|
||||
raise lib_exc.TimeoutException(msg)
|
||||
|
||||
def wait_provisioning_state(self, node_id, state, timeout):
|
||||
self._node_state_timeout(
|
||||
@ -1297,7 +1297,7 @@ class BaremetalScenarioTest(ScenarioTest):
|
||||
_get_node, CONF.baremetal.association_timeout, 1):
|
||||
msg = ('Timed out waiting to get Ironic node by instance id %s'
|
||||
% instance_id)
|
||||
raise exceptions.TimeoutException(msg)
|
||||
raise lib_exc.TimeoutException(msg)
|
||||
|
||||
def get_node(self, node_id=None, instance_id=None):
|
||||
if node_id:
|
||||
|
@ -22,9 +22,9 @@ import testtools
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest.common import waiters
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest.lib import exceptions
|
||||
from tempest.scenario import manager
|
||||
from tempest import test
|
||||
|
||||
|
@ -21,7 +21,6 @@ import testtools
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest.common import waiters
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.lib.common.utils import test_utils
|
||||
from tempest.lib import decorators
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
@ -93,7 +92,7 @@ class TestStampPattern(manager.ScenarioTest):
|
||||
if not test_utils.call_until_true(_func,
|
||||
CONF.compute.build_timeout,
|
||||
CONF.compute.build_interval):
|
||||
raise exceptions.TimeoutException
|
||||
raise lib_exc.TimeoutException
|
||||
|
||||
@decorators.skip_because(bug="1205344")
|
||||
@test.idempotent_id('10fd234a-515c-41e5-b092-8323060598c5')
|
||||
|
@ -178,7 +178,7 @@ class OrchestrationClient(rest_client.RestClient):
|
||||
'within the required time (%s s).' %
|
||||
(stack_name, status, stack_status,
|
||||
self.build_timeout))
|
||||
raise exceptions.TimeoutException(message)
|
||||
raise lib_exc.TimeoutException(message)
|
||||
time.sleep(self.build_interval)
|
||||
|
||||
def show_resource_metadata(self, stack_identifier, resource_name):
|
||||
|
@ -18,6 +18,7 @@ import mock
|
||||
|
||||
from tempest.common import waiters
|
||||
from tempest import exceptions
|
||||
from tempest.lib import exceptions as lib_exc
|
||||
from tempest.lib.services.volume.v2 import volumes_client
|
||||
from tempest.tests import base
|
||||
import tempest.tests.utils as utils
|
||||
@ -43,7 +44,7 @@ class TestImageWaiters(base.TestCase):
|
||||
time_mock.side_effect = utils.generate_timeout_series(1)
|
||||
|
||||
self.client.show_image.return_value = ({'status': 'saving'})
|
||||
self.assertRaises(exceptions.TimeoutException,
|
||||
self.assertRaises(lib_exc.TimeoutException,
|
||||
waiters.wait_for_image_status,
|
||||
self.client, 'fake_image_id', 'active')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user