From: Yong Sheng Gong Date: Sat, 11 Aug 2012 23:50:22 +0000 (+0800) Subject: normalize the json output of show a given extension. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4e29c8aa9f44355c6bae33bb92c7467b4f035006;p=openstack-build%2Fneutron-build.git normalize the json output of show a given extension. we should use {'extension':{}} for a given extension query to comply with our API design. Change-Id: Id0b04b29bed4be92498c04178e268c31e9a1d635 --- diff --git a/quantum/extensions/extensions.py b/quantum/extensions/extensions.py index af7f91d41..f7dd55cb2 100644 --- a/quantum/extensions/extensions.py +++ b/quantum/extensions/extensions.py @@ -221,7 +221,7 @@ class ExtensionController(wsgi.Controller): if not ext: raise webob.exc.HTTPNotFound( _("Extension with alias %s does not exist") % id) - return self._translate(ext) + return dict(extension=self._translate(ext)) def delete(self, request, id): raise webob.exc.HTTPNotFound() diff --git a/quantum/tests/unit/test_extensions.py b/quantum/tests/unit/test_extensions.py index 777c745f4..d86c4784f 100644 --- a/quantum/tests/unit/test_extensions.py +++ b/quantum/tests/unit/test_extensions.py @@ -454,7 +454,7 @@ class ExtensionControllerTest(unittest.TestCase): def test_extension_can_be_accessed_by_alias(self): foxnsox_extension = self.test_app.get("/extensions/FOXNSOX").json - + foxnsox_extension = foxnsox_extension['extension'] self.assertEqual(foxnsox_extension["alias"], "FOXNSOX") self.assertEqual(foxnsox_extension["namespace"], "http://www.fox.in.socks/api/ext/pie/v1.0")