summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Lee <limingjiang@huawei.com>2017-07-06 12:21:22 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-06 12:21:22 +0000
commit41136dafb30d0c410e92f9f7a7c19eae60f224e2 (patch)
tree111f6e3975f73e5dc44025f330bd6da6f788cc1b
parente8da5039e00da77c06c7acd481e2b6732ba6762f (diff)
parent0bcd7b642a6223ccbcb4a8ca0cdd0ccdef6ade64 (diff)
Merge "Improvement: delete stack if create stack failed"
-rw-r--r--yardstick/orchestrator/heat.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py
index fd6c4f6ff..7958b1cfb 100644
--- a/yardstick/orchestrator/heat.py
+++ b/yardstick/orchestrator/heat.py
@@ -564,8 +564,9 @@ name (i.e. %s).\
for status in iter(self.status, u'CREATE_COMPLETE'):
log.debug("stack state %s", status)
if status == u'CREATE_FAILED':
- raise RuntimeError(
- heat_client.stacks.get(self.uuid).stack_status_reason)
+ stack_status_reason = heat_client.stacks.get(self.uuid).stack_status_reason
+ heat_client.stacks.delete(self.uuid)
+ raise RuntimeError(stack_status_reason)
if time.time() > time_limit:
raise RuntimeError("Heat stack create timeout")