Commit 59f8284b authored by Grégory Wisniewski's avatar Grégory Wisniewski

When leaving the operational state, we can iterate over a list a connection with

nodes not fully identified (so with UUIDs/Code instance).


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@824 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7267d589
...@@ -603,13 +603,12 @@ class Application(object): ...@@ -603,13 +603,12 @@ class Application(object):
# and client nodes. Abort connections to client nodes. # and client nodes. Abort connections to client nodes.
logging.critical('No longer operational, so stopping the service') logging.critical('No longer operational, so stopping the service')
for conn in em.getConnectionList(): for conn in em.getConnectionList():
uuid = conn.getUUID() node = nm.getNodeByUUID(conn.getUUID())
if uuid is not None: if node is not None and node.getNodeType() in \
node = nm.getNodeByUUID(uuid) (STORAGE_NODE_TYPE, CLIENT_NODE_TYPE):
if node.getNodeType() in (STORAGE_NODE_TYPE, CLIENT_NODE_TYPE): conn.notify(protocol.stopOperation())
conn.notify(protocol.stopOperation()) if node.getNodeType() == CLIENT_NODE_TYPE:
if node.getNodeType() == CLIENT_NODE_TYPE: conn.abort()
conn.abort()
# Then, go back, and restart. # Then, go back, and restart.
return return
......
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