Commit 377972f4 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix bug in instance listing with orphan instances



Nodes can return unknown instances, so we shouldn't use the name as an
index without checking.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent c24e519e
......@@ -3910,10 +3910,16 @@ class _InstanceQuery(_QueryBase):
bad_nodes.append(name)
elif result.payload:
for inst in result.payload:
if all_info[inst].primary_node == name:
live_data.update(result.payload)
if inst in all_info:
if all_info[inst].primary_node == name:
live_data.update(result.payload)
else:
wrongnode_inst.add(inst)
else:
wrongnode_inst.add(inst)
# orphan instance; we don't list it here as we don't
# handle this case yet in the output of instance listing
logging.warning("Orphan instance '%s' found on node %s",
inst, name)
# else no instance is alive
else:
live_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