diff --git a/neutron/pecan_wsgi/controllers/resource.py b/neutron/pecan_wsgi/controllers/resource.py index 225ac5b4392..31330dd8f7c 100644 --- a/neutron/pecan_wsgi/controllers/resource.py +++ b/neutron/pecan_wsgi/controllers/resource.py @@ -106,7 +106,7 @@ class ItemController(utils.NeutronPecanController): # Bulk update is not supported, 'resources' always contains a single # elemenet data = {self.resource: resources[0]} - return updater(neutron_context, self.item, data) + return {self.resource: updater(neutron_context, self.item, data)} @utils.when(index, method='DELETE') def delete(self): diff --git a/neutron/tests/functional/pecan_wsgi/test_controllers.py b/neutron/tests/functional/pecan_wsgi/test_controllers.py index 4486361b04c..70939d601b1 100644 --- a/neutron/tests/functional/pecan_wsgi/test_controllers.py +++ b/neutron/tests/functional/pecan_wsgi/test_controllers.py @@ -264,6 +264,11 @@ class TestResourceController(TestRootController): params={'port': {'name': 'test'}}, headers={'X-Project-Id': 'tenid'}) self.assertEqual(response.status_int, 200) + json_body = jsonutils.loads(response.body) + self.assertEqual(1, len(json_body)) + self.assertIn('port', json_body) + self.assertEqual('test', json_body['port']['name']) + self.assertEqual('tenid', json_body['port']['tenant_id']) def test_delete(self): response = self.app.delete('/v2.0/ports/%s.json' % self.port['id'],