Commit f5ef50e8 authored by Romain Courteaud's avatar Romain Courteaud

slapos_upgrader: instances do not always have a predecessor

parent 74bc8891
......@@ -60,7 +60,7 @@ else:
# invert the instance references, to ensure cdn keep the same domain name
# as we also want to keep subobject (login), change the instance from one tree into another
original_predecessor = instance.getSuccessorRelatedValue()
assert original_predecessor is not None
if original_predecessor is not None:
successor_list = original_predecessor.getSuccessorList()
successor_list = [x.replace(instance.getRelativeUrl(), requested_software_instance.getRelativeUrl()) for x in successor_list]
......@@ -79,6 +79,7 @@ else:
aggregate_value=remote_partition,
follow_up_value=remote_instance_tree.getFollowUpValue()
)
if original_predecessor is not None:
original_predecessor.edit(
successor_list=successor_list
)
......
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