Fix error message when a stack is not deleted

When a stack is not deleted and the retry loop ends, tobiko raises an
exception with the following error message:
HeatStackDeletionFailed: stack <name> status 'DELETE_COMPLETE' not in
{'DELETE_COMPLETE'}

This is a misleading message fixed by this patch, because the real
problem is that the stack remains in DELETE_COMPLETE status and was not
properly deleted

Change-Id: I661e7e727e60dc16195e6589fac47aa7ecb16f0c
This commit is contained in:
Eduardo Olivares 2023-05-17 13:21:19 +02:00
parent 0962d8e266
commit 1408422d72
1 changed files with 5 additions and 2 deletions

View File

@ -415,14 +415,17 @@ class HeatStackFixture(tobiko.SharedFixture):
LOG.debug(f"Stack {self.stack_name} disappeared")
break
assert stack.stack_status == DELETE_COMPLETE
if attempt.is_last:
if stack.stack_status != DELETE_COMPLETE:
raise HeatStackDeletionFailed(
name=self.stack_name,
observed=stack.stack_status,
expected={DELETE_COMPLETE},
status_reason=stack.stack_status_reason)
if attempt.is_last:
tobiko.fail(f"Stack {self.stack_name} in status "
f"{DELETE_COMPLETE}, but still present")
cached = False
LOG.debug("Waiting for deleted stack to disappear: '%s'",
self.stack_name)