Fix node list
Fixes AttributeError when attempting to list nodes. Change-Id: Ic2949ca52cc003b1243cf8d2938888266ac1f524
This commit is contained in:
parent
761e79dae0
commit
e6759c5a78
@ -229,7 +229,8 @@ class Node(base.APIResourceWrapper):
|
|||||||
server = servers_dict.get(n.instance_uuid, None)
|
server = servers_dict.get(n.instance_uuid, None)
|
||||||
nodes_with_instance.append(cls(n, instance=server,
|
nodes_with_instance.append(cls(n, instance=server,
|
||||||
request=request))
|
request=request))
|
||||||
return nodes_with_instance
|
return [cls.get(request, node.uuid)
|
||||||
|
for node in nodes_with_instance]
|
||||||
return [cls.get(request, node.uuid) for node in nodes]
|
return [cls.get(request, node.uuid) for node in nodes]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -97,9 +97,15 @@ class NodeAPITests(test.APITestCase):
|
|||||||
node = self.ironicclient_nodes.first()
|
node = self.ironicclient_nodes.first()
|
||||||
nodes = self.ironicclient_nodes.list()
|
nodes = self.ironicclient_nodes.list()
|
||||||
|
|
||||||
with mock_ironicclient(node=node, nodes=nodes), mock.patch(
|
with mock_ironicclient(
|
||||||
|
node=node,
|
||||||
|
nodes=nodes
|
||||||
|
), mock.patch(
|
||||||
'openstack_dashboard.api.nova.server_list',
|
'openstack_dashboard.api.nova.server_list',
|
||||||
return_value=(instances, None),
|
return_value=(instances, None),
|
||||||
|
), mock.patch(
|
||||||
|
'openstack_dashboard.api.nova.server_get',
|
||||||
|
return_value=instances[0],
|
||||||
):
|
):
|
||||||
ret_val = api.node.Node.list(self.request)
|
ret_val = api.node.Node.list(self.request)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user