From a9c0547673a686360d7f7504ce92f56bb6337b1f Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Wed, 19 Dec 2012 18:48:25 +0100 Subject: [PATCH] ReST API: Improve format of resource_types response Wrap the list in a JSON object for consistency with other APIs, both in Heat and the rest of OpenStack. Change-Id: I626f1c2446416c8e869fdc7d4f3772ec6c6d191c Signed-off-by: Zane Bitter --- heat/api/openstack/v1/stacks.py | 2 +- heat/tests/test_api_openstack_v1.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/heat/api/openstack/v1/stacks.py b/heat/api/openstack/v1/stacks.py index b6d693ec..70894f47 100644 --- a/heat/api/openstack/v1/stacks.py +++ b/heat/api/openstack/v1/stacks.py @@ -316,7 +316,7 @@ class StackController(object): except rpc_common.RemoteError as ex: raise exc.HTTPInternalServerError(explanation=str(ex)) - return types + return {'resource_types': types} def create_resource(options): diff --git a/heat/tests/test_api_openstack_v1.py b/heat/tests/test_api_openstack_v1.py index 4511762a..e6544761 100644 --- a/heat/tests/test_api_openstack_v1.py +++ b/heat/tests/test_api_openstack_v1.py @@ -809,7 +809,7 @@ class StackControllerTest(ControllerTest, unittest.TestCase): self.m.ReplayAll() response = self.controller.list_resource_types(req, tenant_id=self.tenant) - self.assertEqual(response, engine_response) + self.assertEqual(response, {'resource_types': engine_response}) self.m.VerifyAll() def test_list_resource_types_error(self): -- 2.45.2