]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat API : Align DescribeStacks response with AWS docs
authorSteven Hardy <shardy@redhat.com>
Mon, 25 Jun 2012 13:15:51 +0000 (14:15 +0100)
committerSteven Hardy <shardy@redhat.com>
Mon, 25 Jun 2012 13:15:51 +0000 (14:15 +0100)
Reformat the DescribeStacks response to more closely align
with the AWS API spec - boto parses the result correctly with
these changes.  Ref #125

Change-Id: I23b270c040653f404014807de79c85b2ab63c85f
Signed-off-by: Steven Hardy <shardy@redhat.com>
heat/api/v1/stacks.py
heat/engine/manager.py

index 9f5283160442e234aacf5eb59d760057a29437c9..f0c4342f0197b28cd6231565d4f97355a63ca23d 100644 (file)
@@ -98,6 +98,12 @@ class StackController(object):
         res = {'DescribeStacksResult': {'Stacks': []}}
         stacks = res['DescribeStacksResult']['Stacks']
         for s in stack_list['stacks']:
+            # Reformat Parameters dict-of-dict into AWS API format
+            # This is a list-of-dict with nasty "ParameterKey" : key
+            # "ParameterValue" : value format.
+            s['Parameters'] = [{'ParameterKey':k,
+                'ParameterValue':v.get('Default')}
+                for (k, v) in s['Parameters'].items()]
             stacks.append(self._stackid_addprefix(s))
 
         return res
index fd8b44a5e1a9f798efdd67a161d5d91bc8986a64..088f9167e752b8c064f45917c59048e7c279aec2 100644 (file)
@@ -130,7 +130,7 @@ class EngineManager(manager.Manager):
             mem['NotificationARNs'] = 'TODO'
             mem['Parameters'] = ps.t['Parameters']
             mem['TimeoutInMinutes'] = ps.t.get('Timeout', '60')
-            mem['TemplateDescription'] = ps.t.get('Description',
+            mem['Description'] = ps.t.get('Description',
                                                   'No description')
             mem['StackStatus'] = s.status
             mem['StackStatusReason'] = s.status_reason