Skip to content

Fix bug when syncing interfaces installed in a module#476

Merged
gsnider2195 merged 5 commits intodevelopfrom
NAPPS-799/modular-interfaces-fix
Jan 9, 2026
Merged

Fix bug when syncing interfaces installed in a module#476
gsnider2195 merged 5 commits intodevelopfrom
NAPPS-799/modular-interfaces-fix

Conversation

@gsnider2195
Copy link
Copy Markdown
Contributor

@gsnider2195 gsnider2195 commented Jan 6, 2026

Closes: NAPPS-799

Bug

When onboarding a Device that uses a DeviceType with InterfaceTemplates attached to ModuleTypes, the Device will be created with interfaces that have a null device field. On subsequent Sync Network Data jobs, the job will try to recreate the interface attached directly to the device instead of attached to the module.

What's Changed

What this PR does: This PR makes the diffsync Nautobot adapters aware of existing interfaces connected to devices through modules (Interface.device is null but Interface.module is not null).

What this PR does not do: Change any of the diffsync Network adapters to parse module information or onboard Device Modules.

To Do

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 6, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  nautobot_device_onboarding
  constants.py
  nautobot_device_onboarding/diffsync/adapters
  sync_devices_adapters.py
  sync_network_data_adapters.py 199-200, 256, 358, 363
  nautobot_device_onboarding/diffsync/models
  sync_devices_models.py
  sync_network_data_models.py 593
Project Total  

This report was generated by python-coverage-comment-action

@gsnider2195 gsnider2195 marked this pull request as ready for review January 8, 2026 22:42
@gsnider2195 gsnider2195 changed the title Fix bug when encountering interfaces installed in a module Fix bug when syncing interfaces installed in a module Jan 8, 2026
Copy link
Copy Markdown
Contributor

@smk4664 smk4664 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I see some improvements in here that should lower the repetitive database hits by using data we already received from a previous query instead of doing a new filter.

Copy link
Copy Markdown
Contributor

@jeffkala jeffkala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. As long as all the testing is still working I'm satisfied.

@gsnider2195 gsnider2195 merged commit 27992ca into develop Jan 9, 2026
15 checks passed
@gsnider2195 gsnider2195 deleted the NAPPS-799/modular-interfaces-fix branch January 9, 2026 17:43
gsnider2195 added a commit that referenced this pull request Jan 12, 2026
@smk4664 smk4664 mentioned this pull request Jan 21, 2026
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.

4 participants