]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
v2 volume/snapshot create will correctly give a 202 response
authorMike Perez <thingee@gmail.com>
Sun, 10 Feb 2013 20:34:44 +0000 (12:34 -0800)
committerMike Perez <thingee@gmail.com>
Tue, 12 Feb 2013 10:26:50 +0000 (02:26 -0800)
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

cinder/api/v2/snapshots.py
cinder/api/v2/volumes.py

index b8e00d93c4b2752617bd3df6b92b3f4e63fd3c4b..697e1f04c7ab41ae460b3ddcfc965253bbac64a8 100644 (file)
@@ -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."""
index 8f53b6905404478e5206b34a7487ce7c7517e0d1..bfe0b74408ac5c65a6ec3fcddb5446e87457badd 100644 (file)
@@ -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):