]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Show stack description when status is unknown
authorZane Bitter <zbitter@redhat.com>
Fri, 13 Apr 2012 15:58:23 +0000 (17:58 +0200)
committerZane Bitter <zbitter@redhat.com>
Fri, 13 Apr 2012 15:58:23 +0000 (17:58 +0200)
Apply the same improvement that d41193cbff97caf68a5eaa5b105593af17e3339d
made for list_stacks to show_stack.

Signed-off-by: Zane Bitter <zbitter@redhat.com>
heat/engine/manager.py

index d3f81d250445d9b546b470ac4aa76421bbd334b1..bf2a84caf7de1764e23467b0405b9b6a0e49d995 100644 (file)
@@ -69,12 +69,8 @@ class EngineManager(manager.Manager):
             mem['Parameters'] = ps.t['Parameters']
             mem['StackStatusReason'] = 'TODO'
             mem['TimeoutInMinutes'] = 'TODO'
-            try:
-                mem['TemplateDescription'] = ps.t['Description']
-                mem['StackStatus'] = ps.t['StackStatus']
-            except KeyError:
-                mem['TemplateDescription'] = 'No description'
-                mem['StackStatus'] = 'unknown'
+            mem['TemplateDescription'] = ps.t.get('Description', 'No description')
+            mem['StackStatus'] = ps.t.get('StackStatus', 'unknown')
             res['stacks'].append(mem)
 
         return res