[PR #20457] [MERGED] Fixes #18878: Automatically assign a designated primary MAC address upon creation of a new interface #15930

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20457
Author: @jeremystretch
Created: 9/30/2025
Status: Merged
Merged: 9/30/2025
Merged by: @jnovinger

Base: mainHead: 18878-new-interface-primary-mac-address


📝 Commits (1)

  • 5c569e7 Fixes #18878: Automatically assign a designated primary MAC address upon creation of a new interface

📊 Changes

2 files changed (+23 additions, -3 deletions)

View changed files

📝 netbox/dcim/models/device_components.py (+10 -3)
📝 netbox/dcim/signals.py (+13 -0)

📄 Description

Fixes: #18878

  • Loosen the validation logic on BaseInterface to only raise an error if the designated primary MAC address is assigned to a different interface
  • Introduce the update_mac_address_interface() signal handler to automatically assign the primary MAC address (if any) to a new interface immediately following its creation

🔄 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/20457 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 9/30/2025 **Status:** ✅ Merged **Merged:** 9/30/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `main` ← **Head:** `18878-new-interface-primary-mac-address` --- ### 📝 Commits (1) - [`5c569e7`](https://github.com/netbox-community/netbox/commit/5c569e749a3aa831a8c893e2860d7ff13ed40f49) Fixes #18878: Automatically assign a designated primary MAC address upon creation of a new interface ### 📊 Changes **2 files changed** (+23 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/models/device_components.py` (+10 -3) 📝 `netbox/dcim/signals.py` (+13 -0) </details> ### 📄 Description ### Fixes: #18878 - Loosen the validation logic on BaseInterface to only raise an error if the designated primary MAC address is assigned to a _different_ interface - Introduce the `update_mac_address_interface()` signal handler to automatically assign the primary MAC address (if any) to a new interface immediately following its creation --- <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:24:51 +01:00
adam closed this issue 2025-12-30 00:24:51 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15930