[PR #19086] [MERGED] Fixes #18553: Update site for VMs only if cluster has a site assigned #15521

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19086
Author: @jeremystretch
Created: 4/4/2025
Status: Merged
Merged: 4/4/2025
Merged by: @arthanson

Base: mainHead: 18553-cluster-vm-sync


📝 Commits (1)

  • 17bbcd4 Fixes #18553: Update site for VMs only if cluster has a site assigned

📊 Changes

2 files changed (+10 additions, -8 deletions)

View changed files

📝 netbox/virtualization/apps.py (+0 -7)
📝 netbox/virtualization/signals.py (+10 -1)

📄 Description

Fixes: #18553

  • Unregister VirtualMachine.site as a denormalized field
  • Introduce a post-save handler update_virtualmachine_site() to conditionally update the site assignments of VMs when a cluster is modified

I believe this solves for the use cases in both #18553 and #15020, but additional testing is appreciated.


🔄 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/19086 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 4/4/2025 **Status:** ✅ Merged **Merged:** 4/4/2025 **Merged by:** [@arthanson](https://github.com/arthanson) **Base:** `main` ← **Head:** `18553-cluster-vm-sync` --- ### 📝 Commits (1) - [`17bbcd4`](https://github.com/netbox-community/netbox/commit/17bbcd4455a1675981ffd5f981cc6e42226b6d51) Fixes #18553: Update site for VMs only if cluster has a site assigned ### 📊 Changes **2 files changed** (+10 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `netbox/virtualization/apps.py` (+0 -7) 📝 `netbox/virtualization/signals.py` (+10 -1) </details> ### 📄 Description ### Fixes: #18553 - Unregister VirtualMachine.site as a denormalized field - Introduce a post-save handler `update_virtualmachine_site()` to conditionally update the site assignments of VMs when a cluster is modified I believe this solves for the use cases in both #18553 and #15020, but additional testing is appreciated. --- <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:22:27 +01:00
adam closed this issue 2025-12-30 00:22:27 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15521