From: Steven Hardy Date: Thu, 27 Sep 2012 13:43:34 +0000 (+0100) Subject: heat API : return ResourceProperties as JSON X-Git-Tag: 2014.1~1348 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3c85e1941f95e30b2c592117b4b6b23cecb87bbd;p=openstack-build%2Fheat-build.git heat API : return ResourceProperties as JSON For boto to correctly parse the API DescribeStackEvents action, the ResourceProperties key in the response must be a string, as per the AWS spec, so we encode the properties in a JSON blob Fixes #245 Change-Id: Icd38984836a941ed4a012b06382933bb46f43c4f Signed-off-by: Steven Hardy --- diff --git a/heat/api/cfn/v1/stacks.py b/heat/api/cfn/v1/stacks.py index 8218d2c3..2b8aa65b 100644 --- a/heat/api/cfn/v1/stacks.py +++ b/heat/api/cfn/v1/stacks.py @@ -426,6 +426,8 @@ class StackController(object): } result = api_utils.reformat_dict_keys(keymap, e) + result['ResourceProperties'] = json.dumps( + result['ResourceProperties']) return self._stackid_format(result) diff --git a/heat/tests/test_api_cfn_v1.py b/heat/tests/test_api_cfn_v1.py index ac81fe00..263e5c78 100644 --- a/heat/tests/test_api_cfn_v1.py +++ b/heat/tests/test_api_cfn_v1.py @@ -808,7 +808,7 @@ class StackControllerTest(unittest.TestCase): 'ResourceType': u'AWS::EC2::Instance', 'Timestamp': u'2012-07-23T13:05:39Z', 'StackName': u'wordpress', - 'ResourceProperties': {u'UserData': u'blah'}, + 'ResourceProperties': json.dumps({u'UserData': u'blah'}), 'PhysicalResourceId': None, 'ResourceStatusReason': u'state changed', 'LogicalResourceId': u'WikiDatabase'}]}}}