Commit 568e83bc authored by Grégory Wisniewski's avatar Grégory Wisniewski

A master node must always supply an UUID to the accepted client.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1615 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 00ab5bff
......@@ -19,7 +19,7 @@ from neo import logging
from neo.client.handlers import BaseHandler, AnswerBaseHandler
from neo.pt import MTPartitionTable as PartitionTable
from neo.protocol import NodeTypes, NodeStates
from neo.protocol import NodeTypes, NodeStates, ProtocolError
from neo.util import dump
class PrimaryBootstrapHandler(AnswerBaseHandler):
......@@ -38,14 +38,15 @@ class PrimaryBootstrapHandler(AnswerBaseHandler):
conn.close()
return
# the master must give an UUID
if your_uuid is None:
raise ProtocolError('No UUID supplied')
app.uuid = your_uuid
node = app.nm.getByAddress(conn.getAddress())
conn.setUUID(uuid)
node.setUUID(uuid)
if your_uuid is not None:
# got an uuid from the primary master
app.uuid = your_uuid
# Always create partition table
app.pt = PartitionTable(num_partitions, num_replicas)
......
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