Commit aa4ed196 authored by Grégory Wisniewski's avatar Grégory Wisniewski

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
parent c58318c5
...@@ -25,6 +25,7 @@ from neo.connector import ConnectorException, ConnectorTryAgainException, \ ...@@ -25,6 +25,7 @@ from neo.connector import ConnectorException, ConnectorTryAgainException, \
ConnectorInProgressException, ConnectorConnectionRefusedException, \ ConnectorInProgressException, ConnectorConnectionRefusedException, \
ConnectorConnectionClosedException ConnectorConnectionClosedException
from neo.util import dump from neo.util import dump
from neo.logger import PACKET_LOGGER
def not_closed(func): def not_closed(func):
def decorator(self, *args, **kw): def decorator(self, *args, **kw):
...@@ -357,6 +358,11 @@ class Connection(BaseConnection): ...@@ -357,6 +358,11 @@ class Connection(BaseConnection):
logging.debug('#0x%08x ERROR %-24s %s %s (%s:%d) %s', logging.debug('#0x%08x ERROR %-24s %s %s (%s:%d) %s',
packet.getId(), code, direction, dump(self.uuid), packet.getId(), code, direction, dump(self.uuid),
ip, port, message) 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: else:
logging.debug('#0x%08x %-30s %s %s (%s:%d)', packet.getId(), logging.debug('#0x%08x %-30s %s %s (%s:%d)', packet.getId(),
packet_type, direction, dump(self.uuid), packet_type, direction, dump(self.uuid),
...@@ -367,7 +373,8 @@ class Connection(BaseConnection): ...@@ -367,7 +373,8 @@ class Connection(BaseConnection):
if self.connector is None: if self.connector is None:
return return
self.logPacket(' to ', packet) PACKET_LOGGER.log(self, packet, ' to ')
#self.logPacket(' to ', packet)
try: try:
self.write_buf += packet.encode() self.write_buf += packet.encode()
except PacketMalformedError, m: except PacketMalformedError, m:
......
...@@ -113,6 +113,9 @@ class ClientElectionHandler(ElectionHandler): ...@@ -113,6 +113,9 @@ class ClientElectionHandler(ElectionHandler):
app.negotiating_master_node_set.discard(addr) app.negotiating_master_node_set.discard(addr)
MasterHandler.peerBroken(self, conn) MasterHandler.peerBroken(self, conn)
def handleNotifyClusterInformation(self, conn, packet, state):
logging.warning('Ignore cluster information notification')
def handleAcceptNodeIdentification(self, conn, packet, node_type, def handleAcceptNodeIdentification(self, conn, packet, node_type,
uuid, address, num_partitions, uuid, address, num_partitions,
num_replicas, your_uuid): num_replicas, your_uuid):
......
...@@ -26,7 +26,7 @@ parser = OptionParser() ...@@ -26,7 +26,7 @@ parser = OptionParser()
parser.add_option('-v', '--verbose', action = 'store_true', parser.add_option('-v', '--verbose', action = 'store_true',
help = 'print verbose messages') help = 'print verbose messages')
parser.add_option('-a', '--address', help = 'specify the address (ip:port) ' \ 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') parser.add_option('--handler', help = 'specify the connection handler')
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
...@@ -35,7 +35,7 @@ if ':' in address: ...@@ -35,7 +35,7 @@ if ':' in address:
address, port = address.split(':', 1) address, port = address.split(':', 1)
port = int(port) port = int(port)
else: else:
port = 5555 port = 9999
handler = options.handler or "SocketConnector" handler = options.handler or "SocketConnector"
setupLog('NEOCTL', options.verbose) setupLog('NEOCTL', options.verbose)
......
...@@ -67,6 +67,8 @@ FUNC_TEST_MODULES = [ ...@@ -67,6 +67,8 @@ FUNC_TEST_MODULES = [
# configuration # configuration
UNIT_TESTS = True UNIT_TESTS = True
FUNCTIONAL_TESTS = True FUNCTIONAL_TESTS = True
FUNCTIONAL_TESTS = False
SEND_REPORT = True
SEND_REPORT = False SEND_REPORT = False
CONSOLE_LOG = False CONSOLE_LOG = False
ATTACH_LOG = False # for ZODB test, only the client side is logged ATTACH_LOG = False # for ZODB test, only the client side is logged
......
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