From 61a2b3673402f8be8ac97cc7616f610d657d29a4 Mon Sep 17 00:00:00 2001 From: Mike Perez Date: Sun, 10 Feb 2013 12:34:44 -0800 Subject: [PATCH] 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 --- cinder/api/v2/snapshots.py | 1 + cinder/api/v2/volumes.py | 1 + 2 files changed, 2 insertions(+) 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): -- 2.45.2