Commit d48c6993 authored by Aurel's avatar Aurel

do not send info about admin node to other node


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@554 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7457be46
...@@ -337,16 +337,17 @@ class Application(object): ...@@ -337,16 +337,17 @@ class Application(object):
""" Send informations on all nodes through the given connection """ """ Send informations on all nodes through the given connection """
node_list = [] node_list = []
for n in self.nm.getNodeList(): for n in self.nm.getNodeList():
try: if n.getNodeType() != ADMIN_NODE_TYPE:
ip_address, port = n.getServer() try:
except TypeError: ip_address, port = n.getServer()
ip_address, port = '0.0.0.0', 0 except TypeError:
node_list.append((n.getNodeType(), ip_address, port, ip_address, port = '0.0.0.0', 0
n.getUUID() or INVALID_UUID, n.getState())) node_list.append((n.getNodeType(), ip_address, port,
# Split the packet if too huge. n.getUUID() or INVALID_UUID, n.getState()))
if len(node_list) == 10000: # Split the packet if too huge.
conn.notify(protocol.notifyNodeInformation(node_list)) if len(node_list) == 10000:
del node_list[:] conn.notify(protocol.notifyNodeInformation(node_list))
del node_list[:]
if node_list: if node_list:
conn.notify(protocol.notifyNodeInformation(node_list)) conn.notify(protocol.notifyNodeInformation(node_list))
......
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