Commit a57e35d2 authored by Vincent Pelletier's avatar Vincent Pelletier

Add sanity check when indexing a node by uuid and address in node manager.

parent 8552935d
...@@ -305,6 +305,8 @@ class NodeManager(object): ...@@ -305,6 +305,8 @@ class NodeManager(object):
new_key) new_key)
del index_dict[old_key] del index_dict[old_key]
if new_key is not None: if new_key is not None:
assert index_dict.get(new_key, node) is node, 'Adding %r at %r ' \
'would overwrite %r' % (node, new_key, index_dict[new_key])
index_dict[new_key] = node index_dict[new_key] = node
def _updateIdentified(self, node): def _updateIdentified(self, node):
......
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