Commit f7e544e1 authored by Aurel's avatar Aurel

fix connectionClosed handler


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@126 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent fe182463
...@@ -41,14 +41,15 @@ class ClientEventHandler(EventHandler): ...@@ -41,14 +41,15 @@ class ClientEventHandler(EventHandler):
def connectionClosed(self, conn): def connectionClosed(self, conn):
uuid = conn.getUUID() uuid = conn.getUUID()
if self.app.primary_master_node is None: if self.app.master_conn is None:
EventHandler.connectionClosed(self, conn) EventHandler.connectionClosed(self, conn)
elif uuid == self.app.primary_master_node.getUUID(): elif uuid == self.app.master_conn.getUUID():
logging.critical("connection to primary master node closed") logging.critical("connection to primary master node closed")
raise NEOStorageError("connection to primary master node closed") raise NEOStorageError("connection to primary master node closed")
else: else:
app = self.app app = self.app
node = app.nm.getNodeByUUID(uuid) node = app.nm.getNodeByUUID(uuid)
logging.info("connection to storage node %s closed" %(node.getServer(),))
if isinstance(node, StorageNode): if isinstance(node, StorageNode):
# Notify primary master node that a storage node is temporarily down # Notify primary master node that a storage node is temporarily down
conn = app.master_conn conn = app.master_conn
......
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