Skip to content

Commit

Permalink
use req.HostId instead of req.UHostId when waiting host to shut down …
Browse files Browse the repository at this point in the history
…before detaching (#160)
  • Loading branch information
wangrzneu authored Feb 1, 2024
1 parent 5725c9f commit a27ff96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ucloud/resource_ucloud_disk_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit a27ff96

Please sign in to comment.