Commit 9efd784d authored by Vincent Pelletier's avatar Vincent Pelletier

Replace a local boolean var with proper test nesting.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@993 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 972182cc
......@@ -196,20 +196,18 @@ class PrimaryNotificationsHandler(BaseHandler):
if node_type != STORAGE_NODE_TYPE or state != RUNNING_STATE:
continue
# close connection to this storage if no longer running
closed = False
conn = self.app.em.getConnectionByUUID(uuid)
if conn is not None:
conn.close()
closed = True
if closed and node_type == STORAGE_NODE_TYPE:
# Remove from pool connection
app.cp.removeConnection(n)
# Put fake packets to task queues.
# XXX: this should be done in MTClientConnection
for key in self.dispatcher.message_table.keys():
if id(conn) == key[0]:
queue = self.dispatcher.message_table.pop(key)
queue.put((conn, None))
if node_type == STORAGE_NODE_TYPE:
# Remove from pool connection
app.cp.removeConnection(n)
# Put fake packets to task queues.
# XXX: this should be done in MTClientConnection
for key in self.dispatcher.message_table.keys():
if id(conn) == key[0]:
queue = self.dispatcher.message_table.pop(key)
queue.put((conn, None))
class PrimaryAnswersHandler(AnswerBaseHandler):
""" Handle that process expected packets from the primary master """
......
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