Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo that undeploys vapp instead of vm while deleting a vm #261

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions vcd/resource_vcd_vapp_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,15 +825,15 @@ func resourceVcdVAppVmDelete(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("error getting VM4 : %#v", err)
}

status, err := vapp.GetStatus()
status, err := vm.GetStatus()
if err != nil {
return fmt.Errorf("error getting vApp status: %#v", err)
return fmt.Errorf("error getting VM status: %#v", err)
}

log.Printf("[TRACE] vApp Status:: %s", status)
log.Printf("[TRACE] VM Status:: %s", status)
if status != "POWERED_OFF" {
log.Printf("[TRACE] Undeploying vApp: %s", vapp.VApp.Name)
task, err := vapp.Undeploy()
log.Printf("[TRACE] Undeploying VM: %s", vm.VM.Name)
task, err := vm.Undeploy()
if err != nil {
return fmt.Errorf("error Undeploying: %#v", err)
}
Expand Down