Commit dd8c2c46 authored by Aurel's avatar Aurel

prevent getCellList from failure


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@228 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 4e9c0c73
......@@ -57,10 +57,15 @@ class PartitionTable(object):
def getCellList(self, offset, usable_only = False):
if usable_only:
return [cell for cell in self.partition_list[offset] \
if cell.getState() in (UP_TO_DATE_STATE, FEEDING_STATE)]
return self.partition_list[offset]
try:
return [cell for cell in self.partition_list[offset] \
if cell is not None and cell.getState() in (UP_TO_DATE_STATE, FEEDING_STATE)]
except (TypeError, KeyError):
return []
try:
return self.partition_list[offset]
except KeyError:
return []
def make(self, node_list):
"""Make a new partition table from scratch."""
......
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