Commit 27090dfa authored by Aurel's avatar Aurel

always answer with an answerNodeState message to a setNodeState message


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@693 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4f2ef12a
......@@ -71,9 +71,8 @@ class AdministrationEventHandler(MasterEventHandler):
else:
# I was asked to shutdown
node.setState(state)
ip, port = node.getServer()
node_list = [(node.getNodeType(), ip, port, node.getUUID(), node.getState()),]
conn.answer(protocol.notifyNodeInformation(node_list), packet)
p = protocol.answerNodeState(app.uuid, state)
conn.answer(p, packet)
app.shutdown()
node = app.nm.getNodeByUUID(uuid)
......@@ -83,17 +82,14 @@ class AdministrationEventHandler(MasterEventHandler):
return
if node.getState() == state:
# no change, just notify admin node
node.setState(state)
ip, port = node.getServer()
node_list = [(node.getNodeType(), ip, port, node.getUUID(), node.getState()),]
conn.answer(protocol.notifyNodeInformation(node_list), packet)
p = protocol.answerNodeState(app.uuid, state)
conn.answer(p, packet)
# forward information to all nodes
if node.getState() != state:
node.setState(state)
ip, port = node.getServer()
node_list = [(node.getNodeType(), ip, port, node.getUUID(), node.getState()),]
conn.answer(protocol.notifyNodeInformation(node_list), packet)
p = protocol.answerNodeState(app.uuid, state)
conn.answer(p, packet)
app.broadcastNodeInformation(node)
# If this is a storage node, ask it to start.
if node.getNodeType() == STORAGE_NODE_TYPE and state == RUNNING_STATE:
......
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