From: JingLu5 Date: Thu, 6 Jul 2017 08:33:17 +0000 (+0000) Subject: Improvement: delete stack if create stack failed X-Git-Tag: opnfv-5.0.RC1~420^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F37007%2F4;p=yardstick.git Improvement: delete stack if create stack failed JIRA: YARDSTICK-709 If the stack is CREATE_FAILED during the context deployment, the failed stack should be deleted. Change-Id: I35b28ffae0f4d1f3ea9809d21add5d718dae5c9d Signed-off-by: JingLu5 --- 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")