From fa353b2804b22815735ee0782b448603fa3d6853 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Mon, 5 Feb 2018 13:01:13 -0600 Subject: [PATCH] Correct attachment create success response code The attachment create call was returning HTTP ACCEPTED, which implies an asynchronous operation. This call is not async, so corrected this to return SUCCESS instead. Change-Id: Ieae4e883a77ede0ba0c8a5fca4423f45e0212b2b Closes-bug: #1747481 --- api-ref/source/v3/attachments.inc | 4 ++-- cinder/api/v3/attachments.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api-ref/source/v3/attachments.inc b/api-ref/source/v3/attachments.inc index eaa5ae6b149..e7f7aa39379 100644 --- a/api-ref/source/v3/attachments.inc +++ b/api-ref/source/v3/attachments.inc @@ -178,7 +178,7 @@ Creates an attachment. Available starting in the 3.27 microversion. -Normal response codes: 202 +Normal response codes: 200 Error response codes: badRequest(400), itemNotFound(404) @@ -283,7 +283,7 @@ Complete an attachment for a cinder volume. Available starting in the 3.44 microversion. -Normal response codes: 202 +Normal response codes: 204 Error response codes: badRequest(400), itemNotFound(404) diff --git a/cinder/api/v3/attachments.py b/cinder/api/v3/attachments.py index 4d3bdbb1635..d807c933fc6 100644 --- a/cinder/api/v3/attachments.py +++ b/cinder/api/v3/attachments.py @@ -97,7 +97,7 @@ class AttachmentsController(wsgi.Controller): sort_direction=sort_dirs) @wsgi.Controller.api_version(mv.NEW_ATTACH) - @wsgi.response(202) + @wsgi.response(200) @validation.schema(attachment.create) def create(self, req, body): """Create an attachment. @@ -258,7 +258,7 @@ class AttachmentsController(wsgi.Controller): attachments = self.volume_api.attachment_delete(context, attachment) return attachment_views.ViewBuilder.list(attachments) - @wsgi.response(202) + @wsgi.response(204) @wsgi.Controller.api_version(mv.NEW_ATTACH_COMPLETION) @wsgi.action('os-complete') def complete(self, req, id, body):