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