Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SSOT dependency to 3.0.0 #225

Closed

Conversation

mattmiller87
Copy link

Dependencies in SSOT and nautobot-secrets-providers aren't aligning in the new mgdsvc-nautobot image. Updating to use the new SSOT release for dependency matching.

@mattmiller87
Copy link
Author

Ah, this requires diffsync to go to 3.0.0 which is currently at 2.0.0.

@scetron
Copy link
Contributor

scetron commented Aug 23, 2024

I had done a small bit of testing with Diffsync 3.0 and an old branch of SSoT. You should be able to remove the direct dependency and rely on SSoT (I think) for this.

@gsnider2195 gsnider2195 self-assigned this Aug 30, 2024
@gsnider2195
Copy link
Contributor

There's a bug in diffsync 2.0's class reference for diffsync.DiffSync here that's causing this project to fail on import. There's also an undocumented breaking change in diffsync 2.0 that changed the signature for DiffSyncModel.create from a diffsync kwarg to an adapter kwarg and changing the diffsync model attr to adapter. That change required making a number of changes to this code base. There are still more changes required to get this working and I think they're related to the pydantic upgrade:

2024-08-30 18:20:10,302 - celery.app.trace - ERROR - Task nautobot.extras.jobs.run_job[0b95778b-7363-4c81-902c-0b8e032ebf66] raised unexpected: ValueError("Parameters: {'name': 'demo-cisco-1', 'serial': '9ABUXU581111', 'pk': UUID('4c6f94ba-8a41-4274-8a3d-ac36b87455db')}")
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/contrib/adapter.py", line 147, in _load_single_object
    diffsync_model = diffsync_model(**parameters)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pydantic/main.py", line 193, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for SyncNetworkDataDevice
last_network_data_sync
  Field required [type=missing, input_value={'name': 'demo-cisco-1', ...274-8a3d-ac36b87455db')}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/missing

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 477, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 1136, in run_job
    result = job(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 149, in __call__
    return self.run(*args, **deserialized_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/source/nautobot_device_onboarding/jobs.py", line 692, in run
    super().run(dryrun, memory_profiling, *args, **kwargs)
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 314, in run
    self.sync_data(memory_profiling)
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/jobs/base.py", line 142, in sync_data
    self.load_target_adapter()
  File "/source/nautobot_device_onboarding/jobs.py", line 594, in load_target_adapter
    self.target_adapter.load()
  File "/source/nautobot_device_onboarding/diffsync/adapters/sync_network_data_adapters.py", line 312, in load
    self._load_objects(diffsync_model)
  File "/source/nautobot_device_onboarding/diffsync/adapters/sync_network_data_adapters.py", line 33, in _load_objects
    self._load_single_object(database_object, diffsync_model, parameter_names)
  File "/usr/local/lib/python3.11/site-packages/nautobot_ssot/contrib/adapter.py", line 149, in _load_single_object
    raise ValueError(f"Parameters: {parameters}") from error
ValueError: Parameters: {'name': 'demo-cisco-1', 'serial': '9ABUXU581111', 'pk': UUID('4c6f94ba-8a41-4274-8a3d-ac36b87455db')}

If anybody more familiar with this app would like to pick this up and finish it my work is committed in a branch https://github.com/nautobot/nautobot-app-device-onboarding/tree/u/gas-ssot-3.0

@gsnider2195
Copy link
Contributor

I made the required changes to update to ssot v3.0 in this pr

@gsnider2195 gsnider2195 closed this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants