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.
This commit is contained in:
Tomas Sedovic 2012-04-13 14:43:07 +02:00
parent 957a45c32e
commit d41193cbff
1 changed files with 2 additions and 6 deletions

View File

@ -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