You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until we have this, here is a pattern you can use to deal with this.
class CustomDiff(Diff):
# This order is significant to the order in which diffsync actions are performed.
# Create/update operations happen in this exact order, delete operations in reverse.
order = ["vpn", "role", "vlan", "prefix"]
def get_children(self):
deferred_children = []
for model in self.order:
for child in self.children[model].values():
if child.action == DiffSyncActions.DELETE:
# Insert the deferred deletion actions in reverse order from the general model order as to resolve
# dependencies correctly.
deferred_children.insert(0, child)
else:
yield child
yield from deferred_children
Activity
Kircheneer commentedon Aug 25, 2023
Until we have this, here is a pattern you can use to deal with this.