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
{{ message }}
Repository navigation
Extend sync_from and sync_to to accept an existing diff #76
Currently doing a diff_to/from followed by a sync_to/from, result in calculating the diff twice because sync_to/from are calculating a new diff automatically.
The proposal is to extend sync_from and sync_to to accept an existing diff
self.log_info(message="Loading current data from Data Source...")
diffsync1=DataSourceDiffSync(job=self, sync=self.sync)
diffsync1.load()
self.log_info(message="Loading current data from Nautobot...")
diffsync2=NautobotDiffSync(job=self, sync=self.sync)
diffsync2.load()
diffsync_flags=DiffSyncFlags.CONTINUE_ON_FAILUREself.log_info(message="Calculating diffs...")
diff=diffsync1.diff_to(diffsync_1, flags=diffsync_flags)
ifnotself.kwargs["dry_run"]:
self.log_info(message="Syncing from Data Source to Nautobot...")
diffsync1.sync_to(diffsync2, flags=diffsync_flags, diff=diff). <<<<<<<<<<<self.log_info(message="Sync complete")
Use Case
Performance improvement, there is no need to calculate the diff twice on the same dataset
Activity