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
This is an issue in ssot:contrib CustomRelationshipAnnotation with custom relationships items ordering
Environment
Python version: 3.9.19
Nautobot version: 2.2.3
nautobot-ssot version: 2.6.1
Expected Behavior
No changes are detected after running the sync a 2nd time
Observed Behavior
The same set of changes is detected running the sync multiple times. The only difference is the order of items in the custom relationship.
Steps to Reproduce
define a many-to-many relationship and a ssot job that syncs from external to nautobot
add multiple elements to the relationship in the external system
run the ssot sync. This populates the custom relationship with items, but sometimes in a different order from what's defined in the external system
run the ssot sync again. This second sync should not detect any changes, but sometimes you'll see the same list of detected changes in the Data Sync tab, and ssot attempting to apply the update again in the Sync Logs tab
The text was updated successfully, but these errors were encountered:
Interesting point. There is networktocode/diffsync#25 which would address this, until then, if you need a quick fix for this, I recommend you do something like
class YourAdapter(NautobotAdapter):
...
def load(...):
return_value = super.load(...)
for obj in self.get_all("modelname"):
obj.field = sorted(obj.field, key=lambda o: o.trunk_groups)
self.update(obj)
return return_value
This should sort your values to be consistent - you need to change this such that it matches your other adapter, or change the other adapter, too.
class YourAdapter(NautobotAdapter):
...
def load(self):
super().load()
for obj in self.get_all(self.interface):
obj.trunk_groups = sorted(obj.trunk_groups, key=operator.itemgetter("name"))
self.update(obj)
This is an issue in ssot:contrib CustomRelationshipAnnotation with custom relationships items ordering
Environment
Expected Behavior
No changes are detected after running the sync a 2nd time
Observed Behavior
The same set of changes is detected running the sync multiple times. The only difference is the order of items in the custom relationship.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: