From db6a15f249ef7e1f195e7ac2ada9e8c27aa57dc8 Mon Sep 17 00:00:00 2001 From: Tobias Mollstam Date: Thu, 11 Apr 2024 16:19:07 +0200 Subject: [PATCH] fix to not emit "agent" from params when 0 --- proxmox/config_qemu.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/proxmox/config_qemu.go b/proxmox/config_qemu.go index ae9e9220..30d661de 100644 --- a/proxmox/config_qemu.go +++ b/proxmox/config_qemu.go @@ -182,15 +182,14 @@ func (config ConfigQemu) mapToApiValues(currentConfig ConfigQemu) (rebootRequire params = map[string]interface{}{} + params["agent"] = config.Agent + if config.VmID != 0 { params["vmid"] = config.VmID } if config.Args != "" { params["args"] = config.Args } - if config.Agent != 0 { - params["agent"] = config.Agent - } if config.Balloon >= 1 { params["balloon"] = config.Balloon }