From 60d1a3bdea1f51e871e9e04c57fb685e65f59117 Mon Sep 17 00:00:00 2001 From: hestiahacker <116128976+hestiahacker@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:30:30 -0600 Subject: [PATCH] fix: enable new versions of providers to run on old tfstate files #702 (#923) * fix: enable new versions of providers to run on old tfstate files #702 * feat: re-applying patch to restore backward compatibility with tfstate files --------- Co-authored-by: hestia --- proxmox/resource_vm_qemu.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proxmox/resource_vm_qemu.go b/proxmox/resource_vm_qemu.go index bb241460..c4900fc5 100755 --- a/proxmox/resource_vm_qemu.go +++ b/proxmox/resource_vm_qemu.go @@ -3119,6 +3119,12 @@ func schema_DiskBackup() *schema.Schema { Type: schema.TypeBool, Optional: true, Default: true, + // Convert previous integer values of 0/1 to booleans + StateFunc: func(val interface{}) string { + if val.(string) == "0" {return "false"} + if val.(string) == "1" {return "true"} + return val.(string) + }, } }