diff --git a/nova/api/openstack/compute/versions.py b/nova/api/openstack/compute/versions.py index 50717fa7cf46..e0a0e12d2927 100644 --- a/nova/api/openstack/compute/versions.py +++ b/nova/api/openstack/compute/versions.py @@ -225,14 +225,14 @@ class Versions(wsgi.Resource): @wsgi.serializers(xml=VersionsTemplate, atom=VersionsAtomSerializer) - def index(self, req): + def index(self, req, body=None): """Return all versions.""" builder = views_versions.get_view_builder(req) return builder.build_versions(VERSIONS) @wsgi.serializers(xml=ChoicesTemplate) @wsgi.response(300) - def multi(self, req): + def multi(self, req, body=None): """Return multiple choices.""" builder = views_versions.get_view_builder(req) return builder.build_choices(VERSIONS, req) diff --git a/nova/tests/api/openstack/compute/test_versions.py b/nova/tests/api/openstack/compute/test_versions.py index b77cc2462edd..de4f0097a5dd 100644 --- a/nova/tests/api/openstack/compute/test_versions.py +++ b/nova/tests/api/openstack/compute/test_versions.py @@ -721,3 +721,23 @@ class VersionsSerializerTests(test.NoDBTestCase): 'rel': 'describedby', 'type': 'text/html', 'href': EXP_LINKS['v2.0']['html']}) + + def test_multi_choice_image_with_body(self): + req = webob.Request.blank('/images/1') + req.accept = "application/json" + req.method = 'POST' + req.content_type = "application/json" + req.body = "{\"foo\": \"bar\"}" + res = req.get_response(fakes.wsgi_app()) + self.assertEqual(300, res.status_int) + self.assertEqual("application/json", res.content_type) + + def test_get_version_list_with_body(self): + req = webob.Request.blank('/') + req.accept = "application/json" + req.method = 'POST' + req.content_type = "application/json" + req.body = "{\"foo\": \"bar\"}" + res = req.get_response(fakes.wsgi_app()) + self.assertEqual(200, res.status_int) + self.assertEqual("application/json", res.content_type)