Commit 511433ca authored by Vincent Pelletier's avatar Vincent Pelletier

Change "if" into "elif": it is obviously wrong to call...

Change "if" into "elif": it is obviously wrong to call app.master_conn.getUUID() on None, so this test should only be executed in "not None" case.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@305 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 9c56ea85
...@@ -105,7 +105,7 @@ class ClientEventHandler(EventHandler): ...@@ -105,7 +105,7 @@ class ClientEventHandler(EventHandler):
if app.primary_master_node is None: if app.primary_master_node is None:
# Failed to connect to a master node # Failed to connect to a master node
app.primary_master_node = -1 app.primary_master_node = -1
if app.master_conn is not None and uuid == app.master_conn.getUUID(): elif app.master_conn is not None and uuid == app.master_conn.getUUID():
logging.critical("connection to primary master node closed") logging.critical("connection to primary master node closed")
# Close connection # Close connection
app.master_conn.close() app.master_conn.close()
...@@ -128,7 +128,7 @@ class ClientEventHandler(EventHandler): ...@@ -128,7 +128,7 @@ class ClientEventHandler(EventHandler):
if app.primary_master_node is None: if app.primary_master_node is None:
# Failed to connect to a master node # Failed to connect to a master node
app.primary_master_node = -1 app.primary_master_node = -1
if app.master_conn is not None and uuid == app.primary_master_node.getUUID(): elif app.master_conn is not None and uuid == app.primary_master_node.getUUID():
logging.critical("connection timeout to primary master node expired") logging.critical("connection timeout to primary master node expired")
self.dispatcher.connectToPrimaryMasterNode(app, conn) self.dispatcher.connectToPrimaryMasterNode(app, conn)
else: else:
...@@ -146,7 +146,7 @@ class ClientEventHandler(EventHandler): ...@@ -146,7 +146,7 @@ class ClientEventHandler(EventHandler):
if app.primary_master_node is None: if app.primary_master_node is None:
# Failed to connect to a master node # Failed to connect to a master node
app.primary_master_node = -1 app.primary_master_node = -1
if app.master_conn is not None and uuid == app.primary_master_node.getUUID(): elif app.master_conn is not None and uuid == app.primary_master_node.getUUID():
logging.critical("primary master node is broken") logging.critical("primary master node is broken")
self.dispatcher.connectToPrimaryMasterNode(app, conn) self.dispatcher.connectToPrimaryMasterNode(app, conn)
else: else:
......
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