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
This commit is contained in:
Sean McGinnis 2018-02-05 13:01:13 -06:00
parent 97207a045f
commit fa353b2804
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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):