From c0d2c62bbbf15d352ebae3397843aa245c163d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alo=C3=AFs=20Micard?= Date: Fri, 2 May 2025 08:20:54 +0200 Subject: [PATCH] Use `NB_CLUSTER_ID` even for VM update --- Changelog.md | 4 ++++ netbox_pve_sync/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 2ab3653..6b88a73 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Use `NB_CLUSTER_ID` even for VM update. + ## [0.2.1] - 01/05/2025 ### Fixed diff --git a/netbox_pve_sync/__init__.py b/netbox_pve_sync/__init__.py index 906bc41..de581bd 100644 --- a/netbox_pve_sync/__init__.py +++ b/netbox_pve_sync/__init__.py @@ -143,7 +143,7 @@ def _process_pve_virtual_machine( else: nb_virtual_machine.name = _pve_virtual_machine['name'] nb_virtual_machine.site = _nb_device.site.id - nb_virtual_machine.cluster = 1 + nb_virtual_machine.cluster = os.environ.get('NB_CLUSTER_ID', 1) nb_virtual_machine.device = _nb_device.id nb_virtual_machine.vcpus = pve_virtual_machine_config['cores'] nb_virtual_machine.memory = int(pve_virtual_machine_config['memory'])