summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn L. Villalovos <john.l.villalovos@intel.com>2015-08-21 16:47:40 -0700
committerJohn L. Villalovos <john.l.villalovos@intel.com>2015-08-21 16:47:40 -0700
commit34104f79bf604418ca18bf1b2d9c71ae288895e1 (patch)
tree3daf287d22340ee0a37ada4ce7d5624495d6bcc5
parentda8f9c8529b67c76bae03c374754b8d74846f302 (diff)
downloadironic-34104f79bf604418ca18bf1b2d9c71ae288895e1.tar.gz
Fix nits from 'HTTP constants' patch
Fix the nits from the review of patch: Replace HTTP 'magic numbers' with constants commit d0c6d84880e4f59dc2e9f7c087354b1f910ff49f Change-Id: I95b1e0881d59148438889397b659190796fb68b6
-rw-r--r--ironic/api/controllers/v1/node.py2
-rw-r--r--ironic/api/hooks.py2
-rw-r--r--ironic/common/exception.py2
3 files changed, 4 insertions, 2 deletions
diff --git a/ironic/api/controllers/v1/node.py b/ironic/api/controllers/v1/node.py
index f176a523f..65d0c347f 100644
--- a/ironic/api/controllers/v1/node.py
+++ b/ironic/api/controllers/v1/node.py
@@ -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
diff --git a/ironic/api/hooks.py b/ironic/api/hooks.py
index 6861ad6aa..90c1a2f96 100644
--- a/ironic/api/hooks.py
+++ b/ironic/api/hooks.py
@@ -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
diff --git a/ironic/common/exception.py b/ironic/common/exception.py
index 129bb71ab..580d955f7 100644
--- a/ironic/common/exception.py
+++ b/ironic/common/exception.py
@@ -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):