Commit 3bba916e authored by Vincent Pelletier's avatar Vincent Pelletier

Catch IndexError from choice() only.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2292 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent b5b86956
......@@ -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.
......
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