diff --git a/proxmox/preprovision.go b/proxmox/preprovision.go index d21c4cb..3669dde 100644 --- a/proxmox/preprovision.go +++ b/proxmox/preprovision.go @@ -161,10 +161,8 @@ func runCommand( return fmt.Errorf("Error executing command %q: %v", cmd.Command, err) } - cmd.Wait() - if cmd.ExitStatus != 0 { - err = fmt.Errorf( - "Command %q exited with non-zero exit status: %d", cmd.Command, cmd.ExitStatus) + if err := cmd.Wait(); err != nil { + return err } // Wait for output to clean up