Merge "Correct reraising of exception"

This commit is contained in:
Jenkins 2016-07-08 18:28:41 +00:00 committed by Gerrit Code Review
commit de9d6f46ed
3 changed files with 9 additions and 9 deletions

View File

@ -388,7 +388,7 @@ class NodeStatesController(rest.RestController):
# Change error code as 404 seems appropriate because RAID is a
# standard interface and all drivers might not have it.
e.code = http_client.NOT_FOUND
raise e
raise
@expose.expose(None, types.uuid_or_name, wtypes.text,
status_code=http_client.ACCEPTED)
@ -599,7 +599,7 @@ class Node(base.APIBase):
# Change error code because 404 (NotFound) is inappropriate
# response for a POST request to create a Port
e.code = http_client.BAD_REQUEST
raise e
raise
elif value == wtypes.Unset:
self._chassis_uuid = wtypes.Unset
@ -907,7 +907,7 @@ class NodeMaintenanceController(rest.RestController):
topic = pecan.request.rpcapi.get_topic_for(rpc_node)
except exception.NoValidHost as e:
e.code = http_client.BAD_REQUEST
raise e
raise
pecan.request.rpcapi.update_node(pecan.request.context,
rpc_node, topic=topic)
@ -1240,7 +1240,7 @@ class NodesController(rest.RestController):
# list of available drivers and shouldn't request
# one that doesn't exist.
e.code = http_client.BAD_REQUEST
raise e
raise
if node.name != wtypes.Unset and node.name is not None:
error_msg = _("Cannot create node with invalid name '%(name)s'")
@ -1309,7 +1309,7 @@ class NodesController(rest.RestController):
# list of available drivers and shouldn't request
# one that doesn't exist.
e.code = http_client.BAD_REQUEST
raise e
raise
self._check_driver_changed_and_console_enabled(rpc_node, node_ident)
new_node = pecan.request.rpcapi.update_node(
pecan.request.context, rpc_node, topic)
@ -1332,7 +1332,7 @@ class NodesController(rest.RestController):
topic = pecan.request.rpcapi.get_topic_for(rpc_node)
except exception.NoValidHost as e:
e.code = http_client.BAD_REQUEST
raise e
raise
pecan.request.rpcapi.destroy_node(pecan.request.context,
rpc_node.uuid, topic)

View File

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

View File

@ -405,7 +405,7 @@ class Connection(api.Connection):
instance_uuid=values['instance_uuid'],
node=node_id)
else:
raise e
raise
def _do_update_node(self, node_id, values):
with _session_for_write():
@ -600,7 +600,7 @@ class Connection(api.Connection):
raise exception.PortgroupMACAlreadyExists(
mac=values['address'])
else:
raise exc
raise
return ref
def destroy_portgroup(self, portgroup_id):