Commit d126c45d authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/vmware: workstation 9 show stderr if command fails

parent badd5df3
......@@ -143,8 +143,15 @@ func (d *Workstation9LinuxDriver) runAndLog(cmd *exec.Cmd) (string, string, erro
cmd.Stderr = &stderr
err := cmd.Run()
log.Printf("stdout: %s", strings.TrimSpace(stdout.String()))
log.Printf("stderr: %s", strings.TrimSpace(stderr.String()))
stdoutString := strings.TrimSpace(stdout.String())
stderrString := strings.TrimSpace(stderr.String())
if _, ok := err.(*exec.ExitError); ok {
err = fmt.Errorf("VMware error: %s", stderrString)
}
log.Printf("stdout: %s", stdoutString)
log.Printf("stderr: %s", stderrString)
return stdout.String(), stderr.String(), err
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment