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