Commit 434b96a2 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Helga Velroyen
Browse files

Modify query LUs to supoprt as uuid

Make _InstanceQuery gather all network info related to instance's
NICs and in case of NETQ_INST in _NetworkQuery get all network
uuids directly from
Signed-off-by: default avatarDimitris Aragiorgis <>
Reviewed-by: default avatarHelga Velroyen <>
parent 922610c9
......@@ -5860,10 +5860,17 @@ class _InstanceQuery(_QueryBase):
nodes = None
groups = None
if query.IQ_NETWORKS in self.requested_data:
net_uuids = itertools.chain(*(lu.cfg.GetInstanceNetworks(
for i in instance_list))
networks = dict((uuid, lu.cfg.GetNetwork(uuid)) for uuid in net_uuids)
networks = None
return query.InstanceQueryData(instance_list, lu.cfg.GetClusterInfo(),
disk_usage, offline_nodes, bad_nodes,
live_data, wrongnode_inst, consinfo,
nodes, groups)
nodes, groups, networks)
class LUQuery(NoHooksLU):
......@@ -16543,8 +16550,6 @@ class _NetworkQuery(_QueryBase):
network_uuids = self._GetNames(lu, all_networks.keys(),
name_to_uuid = dict((, n.uuid) for n in all_networks.values())
do_instances = query.NETQ_INST in self.requested_data
do_groups = query.NETQ_GROUP in self.requested_data
......@@ -16569,10 +16574,8 @@ class _NetworkQuery(_QueryBase):
network_to_instances = dict((uuid, []) for uuid in network_uuids)
for instance in all_instances.values():
for nic in instance.nics:
net_uuid = name_to_uuid[]
if net_uuid in network_uuids:
if in network_uuids:
if query.NETQ_STATS in self.requested_data:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment