Commit 36991be3 authored by Grégory Wisniewski's avatar Grégory Wisniewski

On the contrary of what said in commit #734, the connection argument is required

on _dropIt() method. Revert it but fix a wrong call at same time.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@736 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 609531fa
......@@ -31,25 +31,25 @@ from neo.util import dump
class ServiceEventHandler(MasterEventHandler):
"""This class deals with events for a service phase."""
def _dropIt(self, node, new_state):
def _dropIt(self, conn, node, new_state):
raise RuntimeError('rhis method must be overriden')
def connectionClosed(self, conn):
node = self.app.nm.getNodeByUUID(conn.getUUID())
if node.getState() == RUNNING_STATE:
self._dropIt(node, TEMPORARILY_DOWN_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(node, TEMPORARILY_DOWN_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, BROKEN_STATE)
self._dropIt(conn, node, BROKEN_STATE)
MasterEventHandler.peerBroken(self, conn)
def handleNotifyNodeInformation(self, conn, packet, node_list):
......@@ -161,7 +161,7 @@ class ClientServiceEventHandler(ServiceEventHandler):
def connectionCompleted(self, conn):
pass
def _dropIt(self, node, new_state):
def _dropIt(self, conn, node, new_state):
app = self.app
node.setState(new_state)
app.broadcastNodeInformation(node)
......@@ -242,7 +242,7 @@ class StorageServiceEventHandler(ServiceEventHandler):
if node.getState() == RUNNING_STATE:
conn.notify(protocol.startOperation())
def _dropIt(self, node, new_state):
def _dropIt(self, conn, node, new_state):
app = self.app
node.setState(new_state)
app.broadcastNodeInformation(node)
......@@ -252,17 +252,17 @@ class StorageServiceEventHandler(ServiceEventHandler):
def connectionClosed(self, conn):
node = self.app.nm.getNodeByUUID(conn.getUUID())
if node.getState() == RUNNING_STATE:
self._dropIt(node, TEMPORARILY_DOWN_STATE)
self._dropIt(conn, node, TEMPORARILY_DOWN_STATE)
def timeoutExpired(self, conn):
node = self.app.nm.getNodeByUUID(conn.getUUID())
if node.getState() == RUNNING_STATE:
self._dropIt(node, TEMPORARILY_DOWN_STATE)
self._dropIt(conn, node, TEMPORARILY_DOWN_STATE)
def peerBroken(self, conn):
node = self.app.nm.getNodeByUUID(conn.getUUID())
if node.getState() != BROKEN_STATE:
self._dropIt(node, BROKEN_STATE)
self._dropIt(conn, node, BROKEN_STATE)
def handleNotifyInformationLocked(self, conn, packet, tid):
uuid = conn.getUUID()
......
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