Merge "Replace HTTP numeric codes with constants"

This commit is contained in:
Zuul 2019-05-03 00:35:41 +00:00 committed by Gerrit Code Review
commit a3df9831bc
2 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,7 @@
"""The volumes attachments API."""
from oslo_log import log as logging
from six.moves import http_client
import webob
from cinder.api import common
@ -99,7 +100,7 @@ class AttachmentsController(wsgi.Controller):
sort_direction=sort_dirs)
@wsgi.Controller.api_version(mv.NEW_ATTACH)
@wsgi.response(200)
@wsgi.response(http_client.OK)
@validation.schema(attachment.create)
def create(self, req, body):
"""Create an attachment.
@ -269,7 +270,7 @@ class AttachmentsController(wsgi.Controller):
attachments = self.volume_api.attachment_delete(context, attachment)
return attachment_views.ViewBuilder.list(attachments)
@wsgi.response(204)
@wsgi.response(http_client.NO_CONTENT)
@wsgi.Controller.api_version(mv.NEW_ATTACH_COMPLETION)
@wsgi.action('os-complete')
def complete(self, req, id, body):

View File

@ -15,6 +15,7 @@
from oslo_utils import strutils
from oslo_utils import timeutils
from six.moves import http_client
from cinder.api import microversions as mv
from cinder.api.openstack import wsgi
@ -37,7 +38,7 @@ class WorkerController(wsgi.Controller):
self.sch_api = sch_rpc.SchedulerAPI()
@wsgi.Controller.api_version(mv.WORKERS_CLEANUP)
@wsgi.response(202)
@wsgi.response(http_client.ACCEPTED)
@validation.schema(workers.cleanup)
def cleanup(self, req, body=None):
"""Do the cleanup on resources from a specific service/host/node."""