Use http code constant instead of int

To keep the consistency, using http_client.ACCEPTED instead
of 202

Change-Id: I9c1a5dedfe0cf1a34224727284b3531b17ea9c1c
This commit is contained in:
malei 2018-03-25 18:06:09 +08:00 committed by melissaml
parent 935f21736a
commit 0cd1fe5d50
7 changed files with 8 additions and 8 deletions

View File

@ -1225,7 +1225,7 @@ class AdminActionsMixin(object):
self._update(context, id, update)
except exception.NotFound as e:
raise webob.exc.HTTPNotFound(six.text_type(e))
return webob.Response(status_int=202)
return webob.Response(status_int=http_client.ACCEPTED)
@Controller.authorize('force_delete')
def _force_delete(self, req, id, body):
@ -1236,7 +1236,7 @@ class AdminActionsMixin(object):
except exception.NotFound as e:
raise webob.exc.HTTPNotFound(six.text_type(e))
self._delete(context, resource, force=True)
return webob.Response(status_int=202)
return webob.Response(status_int=http_client.ACCEPTED)
class Fault(webob.exc.HTTPException):

View File

@ -66,7 +66,7 @@ class DatasetController(wsgi.Controller, wsgi.AdminActionsMixin):
except exception.InvalidLearning as e:
raise exc.HTTPForbidden(explanation=six.text_type(e))
return webob.Response(status_int=202)
return webob.Response(status_int=http_client.ACCEPTED)
def index(self, req):
"""Returns a summary list of datasets."""

View File

@ -66,7 +66,7 @@ class ExperimentController(wsgi.Controller, wsgi.AdminActionsMixin):
except exception.InvalidLearning as e:
raise exc.HTTPForbidden(explanation=six.text_type(e))
return webob.Response(status_int=202)
return webob.Response(status_int=http_client.ACCEPTED)
def index(self, req):
"""Returns a summary list of experiments."""

View File

@ -66,7 +66,7 @@ class LearningController(wsgi.Controller, wsgi.AdminActionsMixin):
except exception.InvalidLearning as e:
raise exc.HTTPForbidden(explanation=six.text_type(e))
return webob.Response(status_int=202)
return webob.Response(status_int=http_client.ACCEPTED)
def index(self, req):
"""Returns a summary list of learnings."""

View File

@ -67,7 +67,7 @@ class ModelEvaluationController(wsgi.Controller, wsgi.AdminActionsMixin):
except exception.InvalidLearning as e:
raise exc.HTTPForbidden(explanation=six.text_type(e))
return webob.Response(status_int=202)
return webob.Response(status_int=http_client.ACCEPTED)
def index(self, req):
"""Returns a summary list of model evaluations."""

View File

@ -177,7 +177,7 @@ class ModelController(wsgi.Controller, ModelMixin, wsgi.AdminActionsMixin):
except exception.InvalidLearning as e:
raise exc.HTTPForbidden(explanation=six.text_type(e))
return webob.Response(status_int=202)
return webob.Response(status_int=http_client.ACCEPTED)
def index(self, req):
"""Returns a summary list of models."""

View File

@ -64,7 +64,7 @@ class TemplateController(wsgi.Controller, wsgi.AdminActionsMixin):
except exception.InvalidLearning as e:
raise exc.HTTPForbidden(explanation=six.text_type(e))
return webob.Response(status_int=202)
return webob.Response(status_int=http_client.ACCEPTED)
def index(self, req):
"""Returns a summary list of templates."""