nautobot / nautobot-app-ssot

Single Source of Truth for Nautobot
https://docs.nautobot.com/projects/ssot/en/latest/
Other
38 stars 41 forks source link

Modular interfaces cause ExampleDataSource job to fail #525

Open gsnider2195 opened 3 months ago

gsnider2195 commented 3 months ago

Environment

Expected Behavior

Job succeeds

Observed Behavior

Job fails with

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/celery/app/trace.py", line 760, in __protected_call__
    return self.run(*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_ssot/jobs/examples.py", line 875, in run
    super().run(dryrun, memory_profiling, *args, **kwargs)
  File "/source/nautobot_ssot/jobs/base.py", line 314, in run
    self.sync_data(memory_profiling)
  File "/source/nautobot_ssot/jobs/base.py", line 133, in sync_data
    self.load_source_adapter()
  File "/source/nautobot_ssot/jobs/examples.py", line 880, in load_source_adapter
    self.source_adapter.load()
  File "/source/nautobot_ssot/jobs/examples.py", line 503, in load
    self.load_interfaces()
  File "/source/nautobot_ssot/jobs/examples.py", line 694, in load_interfaces
    "name": interface["device"]["name"],
            ~~~~~~~~~~~~~~~~~~~^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

Steps to Reproduce

  1. Run Example Data Source job against a Nautobot instance that contains modular interfaces (An interface with a null device)