Fixes #21269: Fix Module installation to replicate Front/Rear Port Mappings from Module Types #458

Closed
opened 2026-04-05 16:33:50 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pheus on 1/27/2026

Fixes: #21269

This PR fixes an issue where front-to-rear port mappings defined on a ModuleType were not carried over when installing the module into a device’s ModuleBay.

When a module is installed, NetBox now correctly replicates the template port mappings into PortMapping instances on the resulting module’s ports, preserving positions and ensuring the expected front/rear relationships (e.g., splice cassettes).

To prevent regressions, this PR also adds coverage to ModuleBayTestCase verifying that:

  • installing a module with template mappings creates the expected PortMapping records, and
  • installing a module without template mappings does not create any mappings.

Thanks for the review!

*Originally created by @pheus on 1/27/2026* ### Fixes: #21269 This PR fixes an issue where front-to-rear port mappings defined on a `ModuleType` were not carried over when installing the module into a device’s `ModuleBay`. When a module is installed, NetBox now correctly replicates the template port mappings into `PortMapping` instances on the resulting module’s ports, preserving positions and ensuring the expected front/rear relationships (e.g., splice cassettes). To prevent regressions, this PR also adds coverage to `ModuleBayTestCase` verifying that: - installing a module with template mappings creates the expected `PortMapping` records, and - installing a module without template mappings does not create any mappings. Thanks for the review!
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#458