[Neo-report] r2292 vincent - /trunk/neo/storage/replicator.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Sun Sep 5 11:14:53 CEST 2010
Author: vincent
Date: Sun Sep 5 11:14:52 2010
New Revision: 2292
Log:
Catch IndexError from choice() only.
Modified:
trunk/neo/storage/replicator.py
Modified: trunk/neo/storage/replicator.py
==============================================================================
--- trunk/neo/storage/replicator.py [iso-8859-1] (original)
+++ trunk/neo/storage/replicator.py [iso-8859-1] Sun Sep 5 11:14:52 2010
@@ -184,11 +184,11 @@ class Replicator(object):
def _startReplication(self):
# Choose a storage node for the source.
app = self.app
+ cell_list = app.pt.getCellList(self.current_partition.getRID(),
+ readable=True)
+ node_list = [cell.getNode() for cell in cell_list
+ if cell.getNodeState() == NodeStates.RUNNING]
try:
- cell_list = app.pt.getCellList(self.current_partition.getRID(),
- readable=True)
- node_list = [cell.getNode() for cell in cell_list
- if cell.getNodeState() == NodeStates.RUNNING]
node = choice(node_list)
except IndexError:
# Not operational.
More information about the Neo-report
mailing list