tolerate HTTPNotFound in scenario manager teardown
When tearing down heat scenario tests, the tearDownClass fails if the
stack has already been deleted, because heatclient raises a HTTPNotFound
exception, so tolerate this in the teardown exception path.
This is required for certain tests where we explicitly delete the stack
from the test rather than relying on test cleanup, for example testing
deletion policy for volumes.
Change-Id: I1bc031ce00c845787311105eacb9afe4f779a3a5
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 0ef34c6..e057c74 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -114,8 +114,10 @@
resource.delete()
except Exception as e:
# If the resource is already missing, mission accomplished.
- # add status code as workaround for bug 1247568
- if (e.__class__.__name__ == 'NotFound' or
+ # - Status code tolerated as a workaround for bug 1247568
+ # - HTTPNotFound tolerated as this is currently raised when
+ # attempting to delete an already-deleted heat stack.
+ if (e.__class__.__name__ in ('NotFound', 'HTTPNotFound') or
(hasattr(e, 'status_code') and e.status_code == 404)):
return
raise