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):
# and client nodes. Abort connections to client nodes.
logging.critical('No longer operational, so stopping the service')
for conn in em.getConnectionList():
uuid = conn.getUUID()
if uuid is not None:
node = nm.getNodeByUUID(uuid)
if node.getNodeType() in (STORAGE_NODE_TYPE, CLIENT_NODE_TYPE):
conn.notify(protocol.stopOperation())
if node.getNodeType() == CLIENT_NODE_TYPE:
conn.abort()
node = nm.getNodeByUUID(conn.getUUID())
if node is not None and node.getNodeType() in \
(STORAGE_NODE_TYPE, CLIENT_NODE_TYPE):
conn.notify(protocol.stopOperation())
if node.getNodeType() == CLIENT_NODE_TYPE:
conn.abort()
# Then, go back, and restart.
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