From: Mike Perez Date: Sun, 10 Feb 2013 20:34:44 +0000 (-0800) Subject: v2 volume/snapshot create will correctly give a 202 response X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=61a2b3673402f8be8ac97cc7616f610d657d29a4;p=openstack-build%2Fcinder-build.git v2 volume/snapshot create will correctly give a 202 response Before it was giving a 200 response. Since the request was received fine but still has to process things, this is a more correct response. In addition this is more consistent with other OpenStack project create rest api calls. Change-Id: I4f29cda7638c257c9cb5be7a5edf2bc4c48626d8 --- diff --git a/cinder/api/v2/snapshots.py b/cinder/api/v2/snapshots.py index b8e00d93c..697e1f04c 100644 --- a/cinder/api/v2/snapshots.py +++ b/cinder/api/v2/snapshots.py @@ -144,6 +144,7 @@ class SnapshotsController(wsgi.Controller): res = [entity_maker(context, snapshot) for snapshot in limited_list] return {'snapshots': res} + @wsgi.response(202) @wsgi.serializers(xml=SnapshotTemplate) def create(self, req, body): """Creates a new snapshot.""" diff --git a/cinder/api/v2/volumes.py b/cinder/api/v2/volumes.py index 8f53b6905..bfe0b7440 100644 --- a/cinder/api/v2/volumes.py +++ b/cinder/api/v2/volumes.py @@ -214,6 +214,7 @@ class VolumeController(wsgi.Controller): return image_uuid + @wsgi.response(202) @wsgi.serializers(xml=VolumeTemplate) @wsgi.deserializers(xml=CreateDeserializer) def create(self, req, body):