Commit 6a695c33 authored by Julien Muchembled's avatar Julien Muchembled

master: do not regenerate UUID if it was unused

parent f8cce9b0
...@@ -433,8 +433,9 @@ class Application(object): ...@@ -433,8 +433,9 @@ class Application(object):
self.cluster_state = state self.cluster_state = state
def getNewUUID(self, uuid, address, node_type): def getNewUUID(self, uuid, address, node_type):
if None != uuid != self.uuid and \ if None != uuid != self.uuid:
self.nm.getByAddress(address) is self.nm.getByUUID(uuid): node = self.nm.getByUUID(uuid)
if node is None or node.getAddress() == address:
return uuid return uuid
while True: while True:
uuid = UUID_NAMESPACES[node_type] + os.urandom(15) uuid = UUID_NAMESPACES[node_type] + os.urandom(15)
......
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