builder/virtualbox: detect vboxmanage errors with zero code [GH-1119]

This commit is contained in:
Mitchell Hashimoto 2014-09-05 09:57:30 -07:00
parent 37f5f00742
commit f54f09d7a3
2 changed files with 9 additions and 0 deletions

View File

@ -69,6 +69,8 @@ BUG FIXES:
* builder/virtualbox/all: Seed RNG to avoid same ports. [GH-1386]
* builder/virtualbox/all: Better error if guest additions URL couldn't be
detected. [GH-1439]
* builder/virtualbox/all: Detect errors even when `VBoxManage` exits
with a zero exit code. [GH-1119]
* builder/virtualbox/iso: Append timestamp to default name for parallel
builds. [GH-1365]
* builder/vmware/all: `ssh_host` accepts templates. [GH-1396]

View File

@ -157,6 +157,13 @@ func (d *VBox42Driver) VBoxManage(args ...string) error {
err = fmt.Errorf("VBoxManage error: %s", stderrString)
}
if err == nil {
m, _ := regexp.MatchString("VBoxManage([.a-z]+?): error:", stderrString)
if m {
err = fmt.Errorf("VBoxManage error: %s", stderrString)
}
}
log.Printf("stdout: %s", stdoutString)
log.Printf("stderr: %s", stderrString)