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): ...@@ -643,7 +643,6 @@ class Application(object):
handler = PrimaryMasterEventHandler(self) handler = PrimaryMasterEventHandler(self)
em = self.em em = self.em
nm = self.nm
# Make sure that every connection has the secondary event handler. # Make sure that every connection has the secondary event handler.
for conn in em.getConnectionList(): for conn in em.getConnectionList():
......
...@@ -30,35 +30,10 @@ class VerificationEventHandler(MasterEventHandler): ...@@ -30,35 +30,10 @@ class VerificationEventHandler(MasterEventHandler):
def connectionCompleted(self, conn): def connectionCompleted(self, conn):
pass pass
def _dropIt(self, conn, node, new_state): def _nodeLost(self, conn, node):
app = self.app if not self.app.pt.operational():
node.setState(new_state)
app.broadcastNodeInformation(node)
if not app.pt.operational():
raise VerificationFailure, 'cannot continue verification' 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): def handleNotifyNodeInformation(self, conn, packet, node_list):
app = self.app app = self.app
for node_type, ip_address, port, uuid, state in node_list: 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