Commit ca70b595 authored by Rafael Monnerat's avatar Rafael Monnerat

proxy: Return None instead assert

  This raise my lead to a significant change on the API, which
  may require to refactor several tests, to this change keep s a
  backward compatible API.
parent 2f34172d
......@@ -557,8 +557,8 @@ def getRootPartition(reference):
"""Climb the partitions tree up by 'requested_by' link to get the root partition."""
p = 'SELECT * FROM %s WHERE reference=?'
partition = execute_db('partition', p, [reference], one=True)
assert partition is not None, "Nonexisting partition \"{}\". Known\n{!s}".format(
reference, execute_db("partition", "select reference, requested_by from %s"))
if partition is None:
return
parent_partition = execute_db('partition', p, [partition['requested_by']], one=True)
while (parent_partition is not None and
......
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