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): ...@@ -184,11 +184,11 @@ class Replicator(object):
def _startReplication(self): def _startReplication(self):
# Choose a storage node for the source. # Choose a storage node for the source.
app = self.app app = self.app
try:
cell_list = app.pt.getCellList(self.current_partition.getRID(), cell_list = app.pt.getCellList(self.current_partition.getRID(),
readable=True) readable=True)
node_list = [cell.getNode() for cell in cell_list node_list = [cell.getNode() for cell in cell_list
if cell.getNodeState() == NodeStates.RUNNING] if cell.getNodeState() == NodeStates.RUNNING]
try:
node = choice(node_list) node = choice(node_list)
except IndexError: except IndexError:
# Not operational. # 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