[Neo-report] r1817 gregory - in /trunk/neo: ./ master/ master/handlers/
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Feb 22 12:42:20 CET 2010
Author: gregory
Date: Mon Feb 22 12:42:20 2010
New Revision: 1817
Log:
Apply the connection on the node after identification.
Remove the binding at connection closure.
Modified:
trunk/neo/connection.py
trunk/neo/master/handlers/identification.py
trunk/neo/master/handlers/storage.py
trunk/neo/master/recovery.py
trunk/neo/master/verification.py
Modified: trunk/neo/connection.py
==============================================================================
--- trunk/neo/connection.py [iso-8859-1] (original)
+++ trunk/neo/connection.py [iso-8859-1] Mon Feb 22 12:42:20 2010
@@ -245,6 +245,10 @@
BaseConnection.close(self)
for event in self.event_dict.itervalues():
self.em.removeIdleEvent(event)
+ from neo.node import NodeManager
+ node = NodeManager.getByUUID(self.getUUID())
+ if node is not None:
+ node.setConnection(None)
self.event_dict.clear()
self.write_buf = ""
self.read_buf = ""
Modified: trunk/neo/master/handlers/identification.py
==============================================================================
--- trunk/neo/master/handlers/identification.py [iso-8859-1] (original)
+++ trunk/neo/master/handlers/identification.py [iso-8859-1] Mon Feb 22 12:42:20 2010
@@ -69,6 +69,7 @@
# set up the node
node.setUUID(uuid)
node.setState(state)
+ node.setConnection(conn)
# set up the connection
conn.setUUID(uuid)
conn.setHandler(handler)
Modified: trunk/neo/master/handlers/storage.py
==============================================================================
--- trunk/neo/master/handlers/storage.py [iso-8859-1] (original)
+++ trunk/neo/master/handlers/storage.py [iso-8859-1] Mon Feb 22 12:42:20 2010
@@ -36,6 +36,8 @@
def nodeLost(self, conn, node):
logging.info('storage node lost')
assert not node.isRunning(), node.getState()
+ node.setConnection(None)
+
if not self.app.pt.operational():
raise OperationFailure, 'cannot continue operation'
# this is intentionaly placed after the raise because the last cell in a
Modified: trunk/neo/master/recovery.py
==============================================================================
--- trunk/neo/master/recovery.py [iso-8859-1] (original)
+++ trunk/neo/master/recovery.py [iso-8859-1] Mon Feb 22 12:42:20 2010
@@ -106,6 +106,7 @@
assert node is not None
if node.getState() == new_state:
return
+ node.setConnection(None)
node.setState(new_state)
def connectionCompleted(self, conn):
Modified: trunk/neo/master/verification.py
==============================================================================
--- trunk/neo/master/verification.py [iso-8859-1] (original)
+++ trunk/neo/master/verification.py [iso-8859-1] Mon Feb 22 12:42:20 2010
@@ -260,6 +260,7 @@
pass
def nodeLost(self, conn, node):
+ node.setConnection(None)
if not self.app.pt.operational():
raise VerificationFailure, 'cannot continue verification'
More information about the Neo-report
mailing list