Add DeleteErrorException
In function “wait_for_server_termination”,it is in the waiting
for server to reach termination. So it's more reasonable to throw
a deleting error exception here when server going error.
This patch adds a DeleteErrorException and let function
“wait_for_server_termination” to use it. This makes the exception
message more clear when server(or other resources) entering error
status in the waiting for deletion.
And the DeleteErrorException will be used
in change I6f92f00b8fe4651c27ff4da783b004d29c526dfe
Change-Id: I6646ce732a4f3802338c8f2a478fd81ff5a16a55
diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index 865db39..509ccc1 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -121,7 +121,7 @@
'/'.join((server_status, str(task_state))),
time.time() - start_time)
if server_status == 'ERROR' and not ignore_error:
- raise exceptions.BuildErrorException(server_id=server_id)
+ raise lib_exc.DeleteErrorException(resource_id=server_id)
if int(time.time()) - start_time >= client.build_timeout:
raise lib_exc.TimeoutException
diff --git a/tempest/lib/exceptions.py b/tempest/lib/exceptions.py
index 108ba70..f79030a 100644
--- a/tempest/lib/exceptions.py
+++ b/tempest/lib/exceptions.py
@@ -259,3 +259,8 @@
class VolumeBackupException(TempestException):
message = "Volume backup %(backup_id)s failed and is in ERROR status"
+
+
+class DeleteErrorException(TempestException):
+ message = ("Resource %(resource_id)s failed to delete "
+ "and is in ERROR status")