From af1db176522cf9ff98a7f56e2f33200ee1e31466 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9gory=20Wisniewski?= <gregory@nexedi.com>
Date: Fri, 26 Jun 2009 08:38:56 +0000
Subject: [PATCH] Bug fix, wrong initialization of default handler. Send
 StartOperation packet to running storage nodes only.

git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@688 71dcc9de-d417-0410-9af5-da40c76e7ee4
---
 neo/master/app.py     | 2 +-
 neo/master/service.py | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/neo/master/app.py b/neo/master/app.py
index fcf730b0..b0070956 100644
--- a/neo/master/app.py
+++ b/neo/master/app.py
@@ -882,7 +882,7 @@ class Application(object):
     def identifyNode(self, node_type, uuid, node):
 
         state = protocol.RUNNING_STATE
-        handler = self.__class__
+        handler = IdentificationEventHandler
 
         if node_type == protocol.ADMIN_NODE_TYPE:
             # always accept admin nodes
diff --git a/neo/master/service.py b/neo/master/service.py
index ba555198..a435eb08 100644
--- a/neo/master/service.py
+++ b/neo/master/service.py
@@ -272,7 +272,9 @@ class ClientServiceEventHandler(ServiceEventHandler):
 class StorageServiceEventHandler(ServiceEventHandler):
 
     def connectionCompleted(self, conn):
-        conn.notify(protocol.startOperation())
+        node = self.app.nm.getNodeByUUID(conn.getUUID())
+        if node.getState() == RUNNING_STATE:
+            conn.notify(protocol.startOperation())
 
     def handleNotifyInformationLocked(self, conn, packet, tid):
         uuid = conn.getUUID()
-- 
2.30.9