Commit 08d0e27f authored by Grégory Wisniewski's avatar Grégory Wisniewski

Replace an assert with raise of IndexError exception when loading a partition with bad offsets.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1473 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 2c0bf157
...@@ -188,7 +188,8 @@ class PartitionTable(object): ...@@ -188,7 +188,8 @@ class PartitionTable(object):
self.clear() self.clear()
self.id = ptid self.id = ptid
for offset, row in row_list: for offset, row in row_list:
assert offset < self.getPartitions() and not self.hasOffset(offset) if offset >= self.getPartitions() or self.hasOffset(offset):
raise IndexError
for uuid, state in row: for uuid, state in row:
node = nm.getByUUID(uuid) node = nm.getByUUID(uuid)
# the node must be known by the node manager # the node must be known by the node manager
......
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