Report stack_status_reason on heat failure

When stack create fails, report the status reason, instead
of just the status. This gives the user useful information about
the cause of the failure (out of floating IPs, etc.) instead of
just "CREATE_FAILED".

Change-Id: Ibbaf14e8959cecfade98d13f8101e333eb76ee6e
Closes-Bug: 1516016
(cherry picked from commit dec8f7ab92)
This commit is contained in:
Chris Buccella 2015-09-12 11:44:43 -04:00 committed by Vitaly Gridnev
parent 0920c6dd05
commit 2c8b1eb28b
3 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,3 @@
---
fixes:
- Heat engine shows reasons in case of failure

View File

@ -54,12 +54,14 @@ class FakeHeatStack(object):
updated_time=None):
self.stack_status = stack_status or ''
self.new_statuses = new_statuses or []
self.stack_status_reason = stack_status or ''
self.idx = 0
self.stack_name = stack_name or ''
self.updated_time = updated_time
def get(self):
self.stack_status = self.new_statuses[self.idx]
self.stack_status_reason = self.new_statuses[self.idx]
self.idx += 1
if self.idx > 0 and self.stack_status == 'UPDATE_COMPLETE':
self.updated_time = self.idx

View File

@ -84,7 +84,7 @@ def wait_stack_completion(stack, is_update=False, last_updated_time=None):
base.execute_with_retries(stack.get)
if stack.status != 'COMPLETE':
raise ex.HeatStackException(stack.stack_status)
raise ex.HeatStackException(stack.stack_status_reason)
def get_resource(stack, resource):