Merge "Fix raises to raise an instance of a class."
This commit is contained in:
commit
66c1ee7707
@ -222,7 +222,7 @@ class ChassisController(rest.RestController):
|
||||
# /detail should only work against collections
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "chassis":
|
||||
raise exception.HTTPNotFound
|
||||
raise exception.HTTPNotFound()
|
||||
|
||||
resource_url = '/'.join(['chassis', 'detail'])
|
||||
return self._get_chassis_collection(marker, limit, sort_key, sort_dir,
|
||||
|
@ -1168,7 +1168,7 @@ class NodesController(rest.RestController):
|
||||
# /detail should only work against collections
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "nodes":
|
||||
raise exception.HTTPNotFound
|
||||
raise exception.HTTPNotFound()
|
||||
|
||||
resource_url = '/'.join(['nodes', 'detail'])
|
||||
return self._get_nodes_collection(chassis_uuid, instance_uuid,
|
||||
@ -1209,7 +1209,7 @@ class NodesController(rest.RestController):
|
||||
of the resource to be returned.
|
||||
"""
|
||||
if self.from_chassis:
|
||||
raise exception.OperationNotPermitted
|
||||
raise exception.OperationNotPermitted()
|
||||
|
||||
api_utils.check_allow_specify_fields(fields)
|
||||
|
||||
@ -1223,7 +1223,7 @@ class NodesController(rest.RestController):
|
||||
:param node: a node within the request body.
|
||||
"""
|
||||
if self.from_chassis:
|
||||
raise exception.OperationNotPermitted
|
||||
raise exception.OperationNotPermitted()
|
||||
|
||||
# NOTE(deva): get_topic_for checks if node.driver is in the hash ring
|
||||
# and raises NoValidHost if it is not.
|
||||
@ -1262,7 +1262,7 @@ class NodesController(rest.RestController):
|
||||
:param patch: a json PATCH document to apply to this node.
|
||||
"""
|
||||
if self.from_chassis:
|
||||
raise exception.OperationNotPermitted
|
||||
raise exception.OperationNotPermitted()
|
||||
|
||||
rpc_node = api_utils.get_rpc_node(node_ident)
|
||||
|
||||
@ -1333,7 +1333,7 @@ class NodesController(rest.RestController):
|
||||
:param node_ident: UUID or logical name of a node.
|
||||
"""
|
||||
if self.from_chassis:
|
||||
raise exception.OperationNotPermitted
|
||||
raise exception.OperationNotPermitted()
|
||||
|
||||
rpc_node = api_utils.get_rpc_node(node_ident)
|
||||
|
||||
|
@ -317,7 +317,7 @@ class PortsController(rest.RestController):
|
||||
# NOTE(lucasagomes): /detail should only work against collections
|
||||
parent = pecan.request.path.split('/')[:-1][-1]
|
||||
if parent != "ports":
|
||||
raise exception.HTTPNotFound
|
||||
raise exception.HTTPNotFound()
|
||||
|
||||
resource_url = '/'.join(['ports', 'detail'])
|
||||
return self._get_ports_collection(node_uuid or node, address, marker,
|
||||
@ -333,7 +333,7 @@ class PortsController(rest.RestController):
|
||||
of the resource to be returned.
|
||||
"""
|
||||
if self.from_nodes:
|
||||
raise exception.OperationNotPermitted
|
||||
raise exception.OperationNotPermitted()
|
||||
|
||||
api_utils.check_allow_specify_fields(fields)
|
||||
|
||||
@ -347,7 +347,7 @@ class PortsController(rest.RestController):
|
||||
:param port: a port within the request body.
|
||||
"""
|
||||
if self.from_nodes:
|
||||
raise exception.OperationNotPermitted
|
||||
raise exception.OperationNotPermitted()
|
||||
|
||||
new_port = objects.Port(pecan.request.context,
|
||||
**port.as_dict())
|
||||
@ -365,7 +365,7 @@ class PortsController(rest.RestController):
|
||||
:param patch: a json PATCH document to apply to this port.
|
||||
"""
|
||||
if self.from_nodes:
|
||||
raise exception.OperationNotPermitted
|
||||
raise exception.OperationNotPermitted()
|
||||
|
||||
rpc_port = objects.Port.get_by_uuid(pecan.request.context, port_uuid)
|
||||
try:
|
||||
@ -407,7 +407,7 @@ class PortsController(rest.RestController):
|
||||
:param port_uuid: UUID of a port.
|
||||
"""
|
||||
if self.from_nodes:
|
||||
raise exception.OperationNotPermitted
|
||||
raise exception.OperationNotPermitted()
|
||||
rpc_port = objects.Port.get_by_uuid(pecan.request.context,
|
||||
port_uuid)
|
||||
rpc_node = objects.Node.get_by_id(pecan.request.context,
|
||||
|
Loading…
x
Reference in New Issue
Block a user