Commit b041a797 authored by Vincent Pelletier's avatar Vincent Pelletier

Care about conflicts when allocating an UUID during identification.

Also, log node's final UUID, not the one it advertised.
parent f4b9e415
...@@ -65,11 +65,10 @@ class IdentificationHandler(MasterHandler): ...@@ -65,11 +65,10 @@ class IdentificationHandler(MasterHandler):
human_readable_node_type = 'n admin ' human_readable_node_type = 'n admin '
else: else:
raise NotImplementedError(node_type) raise NotImplementedError(node_type)
logging.info('Accept a' + human_readable_node_type + dump(uuid))
if uuid is None: while not app.isValidUUID(uuid, address):
# no valid uuid, give it one
uuid = app.getNewUUID(node_type) uuid = app.getNewUUID(node_type)
logging.info('Accept a' + human_readable_node_type + dump(uuid))
if node is None: if node is None:
node = node_ctor(uuid=uuid, address=address) node = node_ctor(uuid=uuid, address=address)
node.setUUID(uuid) node.setUUID(uuid)
......
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