From d41193cbff97caf68a5eaa5b105593af17e3339d Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Fri, 13 Apr 2012 14:43:07 +0200 Subject: [PATCH] Fix listing stacks `heat list` was failing for non-empty stacks because the `Stack` model had no `template` attribute. Also fixed an issue where we didn't show the template description when the stack status was unknown. --- heat/engine/manager.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/heat/engine/manager.py b/heat/engine/manager.py index f50315afc6..9ea416125e 100644 --- a/heat/engine/manager.py +++ b/heat/engine/manager.py @@ -48,12 +48,8 @@ class EngineManager(manager.Manager): mem['stack_id'] = s.id mem['stack_name'] = s.name mem['created_at'] = str(s.created_at) - try: - mem['template_description'] = s.template.description - mem['stack_status'] = ps.t['StackStatus'] - except KeyError: - mem['template_description'] = 'No description' - mem['stack_status'] = 'unknown' + mem['template_description'] = ps.t.get('Description', 'No description') + mem['stack_status'] = ps.t.get('StackStatus', 'unknown') res['stacks'].append(mem) return res