Commit 632c4ef6 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Use connectionLost instead of handleNodeLost that is triggerred only in service

handlers.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1151 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6fc2afe7
......@@ -49,10 +49,6 @@ class SecondaryMasterHandler(MasterHandler):
class PrimaryMasterHandler(MasterHandler):
""" Handler used by secondaries to handle primary master"""
def handleNodeLost(self, conn, node):
self.app.primary_master_node.setState(DOWN_STATE)
raise PrimaryFailure, 'primary master is dead'
def packetReceived(self, conn, packet):
if not conn.isServer():
node = self.app.nm.getNodeByServer(conn.getAddress())
......@@ -60,6 +56,10 @@ class PrimaryMasterHandler(MasterHandler):
node.setState(RUNNING_STATE)
MasterHandler.packetReceived(self, conn, packet)
def connectionLost(self, conn, new_state):
self.app.primary_master_node.setState(DOWN_STATE)
raise PrimaryFailure, 'primary master is dead'
def handleAnnouncePrimaryMaster(self, conn, packet):
raise UnexpectedPacketError
......
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