[Neo-report] r2637 vincent - /trunk/neo/client/pool.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Jan 24 15:17:43 CET 2011
Author: vincent
Date: Mon Jan 24 15:17:43 2011
New Revision: 2637
Log:
Remove NOT_READY.
There is no special case for this state, so just handle it as a failed
connection.
Modified:
trunk/neo/client/pool.py
Modified: trunk/neo/client/pool.py
==============================================================================
--- trunk/neo/client/pool.py [iso-8859-1] (original)
+++ trunk/neo/client/pool.py [iso-8859-1] Mon Jan 24 15:17:43 2011
@@ -38,8 +38,6 @@ CELL_GOOD = 0
# Storage node hosting cell failed recently, low priority
CELL_FAILED = 1
-NOT_READY = object()
-
class ConnectionPool(object):
"""This class manages a pool of connections to storage nodes."""
@@ -78,7 +76,7 @@ class ConnectionPool(object):
except NodeNotReady:
neo.lib.logging.info('%r not ready', node)
self.notifyFailure(node)
- conn = NOT_READY
+ conn = None
else:
neo.lib.logging.info('Connected %r', node)
return conn
@@ -170,7 +168,7 @@ class ConnectionPool(object):
# Create new connection to node
while True:
conn = self._initNodeConnection(node)
- if conn not in (None, NOT_READY):
+ if conn is not None:
self.connection_dict[uuid] = conn
return conn
else:
More information about the Neo-report
mailing list