Commit 82cc20a7 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Handle None from getServer more consistently.

git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@112 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent b9b6704f
......@@ -183,7 +183,10 @@ class RecoveryEventHandler(MasterEventHandler):
# Send the information.
node_list = []
for n in app.nm.getNodeList():
ip_address, port = n.getServer()
try:
ip_address, port = n.getServer()
except TypeError:
ip_address, port = '0.0.0.0', 0
node_list.append((n.getNodeType(), ip_address, port,
n.getUUID() or INVALID_UUID, n.getState()))
if len(node_list) == 10000:
......
......@@ -231,17 +231,10 @@ class ServiceEventHandler(MasterEventHandler):
# Send the information.
node_list = []
for n in app.nm.getNodeList():
addr = n.getServer()
if addr is None:
ip_address, port = None, None
else:
ip_address, port = addr
if ip_address is None:
ip_address = '0.0.0.0'
if port is None:
port = 0
try:
ip_address, port = n.getServer()
except TypeError:
ip_address, port = '0.0.0.0', 0
node_list.append((n.getNodeType(), ip_address, port,
n.getUUID() or INVALID_UUID, n.getState()))
if len(node_list) == 10000:
......
......@@ -198,7 +198,10 @@ class VerificationEventHandler(MasterEventHandler):
# Send the information.
node_list = []
for n in app.nm.getNodeList():
ip_address, port = n.getServer()
try:
ip_address, port = n.getServer()
except TypeError:
ip_address, port = '0.0.0.0', 0
node_list.append((n.getNodeType(), ip_address, port,
n.getUUID() or INVALID_UUID, n.getState()))
if len(node_list) == 10000:
......
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