Skip to content

Commit

Permalink
Use twisted's BAD_REQUEST, FORBIDDEN, and NOT_FOUND constants instead…
Browse files Browse the repository at this point in the history
… of bare HTTP status codes.
  • Loading branch information
cyli committed May 6, 2015
1 parent 40a5710 commit 7ee5b33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mimic/model/nova_objects.py
Expand Up @@ -20,7 +20,7 @@
from mimic.model.behaviors import (
BehaviorRegistry, EventDescription, Criterion, regexp_predicate
)
from twisted.web.http import ACCEPTED
from twisted.web.http import ACCEPTED, BAD_REQUEST, FORBIDDEN, NOT_FOUND


@attributes(['nova_message'])
Expand Down Expand Up @@ -69,7 +69,7 @@ def bad_request(message, request):
:return: dictionary representing the error body.
"""
return _nova_error_message("badRequest", message, 400, request)
return _nova_error_message("badRequest", message, BAD_REQUEST, request)


def not_found(message, request):
Expand All @@ -82,7 +82,7 @@ def not_found(message, request):
:return: dictionary representing the error body.
"""
return _nova_error_message("itemNotFound", message, 404, request)
return _nova_error_message("itemNotFound", message, NOT_FOUND, request)


def forbidden(message, request):
Expand All @@ -95,7 +95,7 @@ def forbidden(message, request):
:return: dictionary representing the error body.
"""
return _nova_error_message("forbidden", message, 403, request)
return _nova_error_message("forbidden", message, FORBIDDEN, request)


@attributes(["collection", "server_id", "server_name", "metadata",
Expand Down

0 comments on commit 7ee5b33

Please sign in to comment.