From: Steven Hardy Date: Mon, 25 Jun 2012 13:15:51 +0000 (+0100) Subject: heat API : Align DescribeStacks response with AWS docs X-Git-Tag: 2014.1~1678 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=34f1bb34a50094bfc13034a03e364017ee2e1151;p=openstack-build%2Fheat-build.git heat API : Align DescribeStacks response with AWS docs 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 --- diff --git a/heat/api/v1/stacks.py b/heat/api/v1/stacks.py index 9f528316..f0c4342f 100644 --- a/heat/api/v1/stacks.py +++ b/heat/api/v1/stacks.py @@ -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 diff --git a/heat/engine/manager.py b/heat/engine/manager.py index fd8b44a5..088f9167 100644 --- a/heat/engine/manager.py +++ b/heat/engine/manager.py @@ -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