This patch fixes a piece of convoluted code in the
implementation of instance queries. There was an
unecessarily nested loop, which in case of ongoing
migrations, could throw a key error. This fixes
issue 875.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
if inst_name in insts_by_name:
instance = insts_by_name[inst_name]
if instance.primary_node == node_uuid:
- for iname in result.payload:
- live_data[insts_by_name[iname].uuid] = result.payload[iname]
+ live_data[insts_by_name[inst_name].uuid] = \
+ result.payload[inst_name]
else:
wrongnode_inst_uuids.add(instance.uuid)
else: