builder/virtualbox: add more logging to version detection

This commit is contained in:
Mitchell Hashimoto 2013-06-29 13:45:30 -07:00
parent 62cfa9983d
commit b317c763ac
1 changed files with 2 additions and 0 deletions

View File

@ -124,11 +124,13 @@ func (d *VBox42Driver) Version() (string, error) {
return "", err
}
log.Printf("VBoxManage --version output: %s", stdout.String())
versionRe := regexp.MustCompile("[^.0-9]")
matches := versionRe.Split(stdout.String(), 2)
if len(matches) == 0 {
return "", fmt.Errorf("No version found: %s", stdout.String())
}
log.Printf("VirtualBox version: %s", matches[0])
return matches[0], nil
}