Commit b8e777af authored by Grégory Wisniewski's avatar Grégory Wisniewski

Same work as done in #825 with forgotten verification handler.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@831 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent f9824313
......@@ -643,7 +643,6 @@ class Application(object):
handler = PrimaryMasterEventHandler(self)
em = self.em
nm = self.nm
# Make sure that every connection has the secondary event handler.
for conn in em.getConnectionList():
......
......@@ -30,35 +30,10 @@ class VerificationEventHandler(MasterEventHandler):
def connectionCompleted(self, conn):
pass
def _dropIt(self, conn, node, new_state):
app = self.app
node.setState(new_state)
app.broadcastNodeInformation(node)
if not app.pt.operational():
def _nodeLost(self, conn, node):
if not self.app.pt.operational():
raise VerificationFailure, 'cannot continue verification'
def connectionClosed(self, conn):
node = self.app.nm.getNodeByUUID(conn.getUUID())
if node.getState() == RUNNING_STATE:
self._dropIt(conn, node, TEMPORARILY_DOWN_STATE)
MasterEventHandler.connectionClosed(self, conn)
def timeoutExpired(self, conn):
node = self.app.nm.getNodeByUUID(conn.getUUID())
if node.getState() == RUNNING_STATE:
self._dropIt(conn, node, TEMPORARILY_DOWN_STATE)
MasterEventHandler.timeoutExpired(self, conn)
def peerBroken(self, conn):
node = self.app.nm.getNodeByUUID(conn.getUUID())
if node.getState() != BROKEN_STATE:
self._dropIt(conn, node, BROKEN_STATE)
# here the node is no more dropped from the partition table anymore
# because it's under the responsability of an administrator to
# restore the node, backup the node content or drop it definitely
# and loose all it's content.
MasterEventHandler.peerBroken(self, conn)
def handleNotifyNodeInformation(self, conn, packet, node_list):
app = self.app
for node_type, ip_address, port, uuid, state in node_list:
......
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