Commit 9637a45a authored by Vincent Pelletier's avatar Vincent Pelletier

Remove NOT_READY.

There is no special case for this state, so just handle it as a failed
connection.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2637 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent f04a71ff
...@@ -38,8 +38,6 @@ CELL_GOOD = 0 ...@@ -38,8 +38,6 @@ CELL_GOOD = 0
# Storage node hosting cell failed recently, low priority # Storage node hosting cell failed recently, low priority
CELL_FAILED = 1 CELL_FAILED = 1
NOT_READY = object()
class ConnectionPool(object): class ConnectionPool(object):
"""This class manages a pool of connections to storage nodes.""" """This class manages a pool of connections to storage nodes."""
...@@ -78,7 +76,7 @@ class ConnectionPool(object): ...@@ -78,7 +76,7 @@ class ConnectionPool(object):
except NodeNotReady: except NodeNotReady:
neo.lib.logging.info('%r not ready', node) neo.lib.logging.info('%r not ready', node)
self.notifyFailure(node) self.notifyFailure(node)
conn = NOT_READY conn = None
else: else:
neo.lib.logging.info('Connected %r', node) neo.lib.logging.info('Connected %r', node)
return conn return conn
...@@ -170,7 +168,7 @@ class ConnectionPool(object): ...@@ -170,7 +168,7 @@ class ConnectionPool(object):
# Create new connection to node # Create new connection to node
while True: while True:
conn = self._initNodeConnection(node) conn = self._initNodeConnection(node)
if conn not in (None, NOT_READY): if conn is not None:
self.connection_dict[uuid] = conn self.connection_dict[uuid] = conn
return conn return 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