[PR #20939] [MERGED] Fixes #19918: Resolve {module} placeholders in nested module bay labels #16092

Closed
opened 2025-12-30 00:25:44 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20939
Author: @jnovinger
Created: 12/6/2025
Status: Merged
Merged: 12/8/2025
Merged by: @jeremystretch

Base: mainHead: 19918-nested-module-token-broken


📝 Commits (1)

  • 5198586 Fixes #19918: Resolve {module} placeholders in nested module bay labels

📊 Changes

3 files changed (+50 additions, -6 deletions)

View changed files

📝 netbox/dcim/models/device_component_templates.py (+2 -2)
📝 netbox/dcim/models/modules.py (+0 -2)
📝 netbox/dcim/tests/test_models.py (+48 -2)

📄 Description

Fixes: #19918

ModuleBayTemplate.instantiate() now calls resolve_name() and resolve_label() to properly resolve {module} placeholders, making it consistent with other modular components like InterfaceTemplate.

When a module with nested module bays is installed (e.g., a module with SFP bays in position "A"), the nested bay labels now correctly show "A-21" instead of "{module}-21".

This also removes the inconsistent fix from #17436 which only handled name resolution post-instantiation. The proper resolution now happens during instantiation using the existing resolve methods.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/20939 **Author:** [@jnovinger](https://github.com/jnovinger) **Created:** 12/6/2025 **Status:** ✅ Merged **Merged:** 12/8/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `19918-nested-module-token-broken` --- ### 📝 Commits (1) - [`5198586`](https://github.com/netbox-community/netbox/commit/51985863cdfef8699b83397ff204ec6173e8e426) Fixes #19918: Resolve {module} placeholders in nested module bay labels ### 📊 Changes **3 files changed** (+50 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/device_component_templates.py` (+2 -2) 📝 `netbox/dcim/models/modules.py` (+0 -2) 📝 `netbox/dcim/tests/test_models.py` (+48 -2) </details> ### 📄 Description ### Fixes: #19918 `ModuleBayTemplate.instantiate()` now calls `resolve_name()` and `resolve_label()` to properly resolve `{module}` placeholders, making it consistent with other modular components like InterfaceTemplate. When a module with nested module bays is installed (e.g., a module with SFP bays in position "A"), the nested bay labels now correctly show "A-21" instead of "{module}-21". This also removes the inconsistent fix from #17436 which only handled name resolution post-instantiation. The proper resolution now happens during instantiation using the existing resolve methods. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:25:44 +01:00
adam closed this issue 2025-12-30 00:25:45 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16092