From aa4ed196a34651459458813078647bde433e1df8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9gory=20Wisniewski?= <gregory@nexedi.com>
Date: Tue, 22 Sep 2009 07:52:51 +0000
Subject: [PATCH] Change default neoadmin port in neoctl to match with the
 default value in neoadmin.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1295 71dcc9de-d417-0410-9af5-da40c76e7ee4
---
 neo/connection.py               | 9 ++++++++-
 neo/master/handlers/election.py | 3 +++
 neoctl                          | 4 ++--
 runner                          | 2 ++
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/neo/connection.py b/neo/connection.py
index 16335a30..2d679b0c 100644
--- a/neo/connection.py
+++ b/neo/connection.py
@@ -25,6 +25,7 @@ from neo.connector import ConnectorException, ConnectorTryAgainException, \
         ConnectorInProgressException, ConnectorConnectionRefusedException, \
         ConnectorConnectionClosedException
 from neo.util import dump
+from neo.logger import PACKET_LOGGER
 
 def not_closed(func):
     def decorator(self, *args, **kw):
@@ -357,6 +358,11 @@ class Connection(BaseConnection):
             logging.debug('#0x%08x ERROR %-24s %s %s (%s:%d) %s',
                 packet.getId(), code, direction, dump(self.uuid),
                 ip, port, message)
+        elif packet_type == protocol.ANSWER_PRIMARY_MASTER:
+            primary, masters = packet.decode()
+            logging.debug('#0x%08x ANSWER_PRIMARY_MASTER : %s/%s  %s %s (%s:%d)' % 
+                    (packet.getId(), dump(primary), masters, direction, 
+                        dump(self.uuid), ip, port))
         else:
             logging.debug('#0x%08x %-30s %s %s (%s:%d)', packet.getId(),
                 packet_type, direction, dump(self.uuid),
@@ -367,7 +373,8 @@ class Connection(BaseConnection):
         if self.connector is None:
             return
 
-        self.logPacket(' to ', packet)
+        PACKET_LOGGER.log(self, packet, ' to ')
+        #self.logPacket(' to ', packet)
         try:
             self.write_buf += packet.encode()
         except PacketMalformedError, m:
diff --git a/neo/master/handlers/election.py b/neo/master/handlers/election.py
index d5fefdbe..c7deac7d 100644
--- a/neo/master/handlers/election.py
+++ b/neo/master/handlers/election.py
@@ -113,6 +113,9 @@ class ClientElectionHandler(ElectionHandler):
         app.negotiating_master_node_set.discard(addr)
         MasterHandler.peerBroken(self, conn)
 
+    def handleNotifyClusterInformation(self, conn, packet, state):
+        logging.warning('Ignore cluster information notification')
+
     def handleAcceptNodeIdentification(self, conn, packet, node_type,
                                        uuid, address, num_partitions,
                                        num_replicas, your_uuid):
diff --git a/neoctl b/neoctl
index 9d0413b3..110a999b 100755
--- a/neoctl
+++ b/neoctl
@@ -26,7 +26,7 @@ parser = OptionParser()
 parser.add_option('-v', '--verbose', action = 'store_true', 
                   help = 'print verbose messages')
 parser.add_option('-a', '--address', help = 'specify the address (ip:port) ' \
-    'of an admin node', default = '127.0.0.1:5555')
+    'of an admin node', default = '127.0.0.1:9999')
 parser.add_option('--handler', help = 'specify the connection handler')
 
 (options, args) = parser.parse_args()
@@ -35,7 +35,7 @@ if ':' in address:
     address, port = address.split(':', 1)
     port = int(port)
 else:
-    port = 5555
+    port = 9999
 handler = options.handler or "SocketConnector"
 
 setupLog('NEOCTL', options.verbose)
diff --git a/runner b/runner
index 78088877..13b7db7a 100755
--- a/runner
+++ b/runner
@@ -67,6 +67,8 @@ FUNC_TEST_MODULES = [
 # configuration 
 UNIT_TESTS = True
 FUNCTIONAL_TESTS = True
+FUNCTIONAL_TESTS = False
+SEND_REPORT = True
 SEND_REPORT = False
 CONSOLE_LOG = False
 ATTACH_LOG = False # for ZODB test, only the client side is logged
-- 
2.30.9