Merge "Fix nits from 'HTTP constants' patch"

This commit is contained in:
Jenkins 2015-08-24 09:45:07 +00:00 committed by Gerrit Code Review
commit d9fccbd5ab
3 changed files with 4 additions and 2 deletions

View File

@ -478,7 +478,7 @@ class Node(base.APIBase):
except exception.ChassisNotFound as e:
# Change error code because 404 (NotFound) is inappropriate
# response for a POST request to create a Port
e.code = http_client.BAD_REQUEST # BadRequest
e.code = http_client.BAD_REQUEST
raise e
elif value == wtypes.Unset:
self._chassis_uuid = wtypes.Unset

View File

@ -135,6 +135,8 @@ class NoExceptionTracebackHook(hooks.PecanHook):
return
# Do nothing if there is no error.
# Status codes in the range 200 (OK) to 399 (400 = BAD_REQUEST) are not
# an error.
if (http_client.OK <= state.response.status_int <
http_client.BAD_REQUEST):
return

View File

@ -443,7 +443,7 @@ class NodeNotLocked(Invalid):
class NoFreeConductorWorker(TemporaryFailure):
message = _('Requested action cannot be performed due to lack of free '
'conductor workers.')
code = http_client.SERVICE_UNAVAILABLE # Service Unavailable (temporary).
code = http_client.SERVICE_UNAVAILABLE
class VendorPassthruException(IronicException):