From d92c3fb67dfa847f339f7c050f61fb8bc043a1a1 Mon Sep 17 00:00:00 2001 From: "renzheng.wang" Date: Thu, 1 Feb 2024 16:08:46 +0800 Subject: [PATCH] use req.HostId instead of req.UHostId when waiting host to shut down before detaching --- ucloud/resource_ucloud_disk_attachment.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ucloud/resource_ucloud_disk_attachment.go b/ucloud/resource_ucloud_disk_attachment.go index 96847131..c7c39990 100644 --- a/ucloud/resource_ucloud_disk_attachment.go +++ b/ucloud/resource_ucloud_disk_attachment.go @@ -115,9 +115,9 @@ func resourceUCloudDiskAttachmentDelete(d *schema.ResourceData, meta interface{} req.HostId = ucloud.String(p[1]) if _, ok := d.GetOk("stop_instance_before_detaching"); ok { - err := WaitAndUpdateInstanceState(client, *req.UHostId, instanceStatusStopped, false, d.Timeout(schema.TimeoutDelete)) + err := WaitAndUpdateInstanceState(client, *req.HostId, instanceStatusStopped, false, d.Timeout(schema.TimeoutDelete)) if err != nil { - return fmt.Errorf("error on stop instance %q before deleting, %s", *req.UHostId, err) + return fmt.Errorf("error on stop instance %q before deleting, %s", *req.HostId, err) } }