Merge pull request #7016 from rickard-von-essen/vmware-tech-prev

vmware: Correctly parse version for VMware Fusion Tech Preview
This commit is contained in:
Megan Marsh 2018-11-28 14:59:53 -08:00 committed by GitHub
commit 11ef407b4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -66,8 +66,17 @@ func (d *Fusion6Driver) Verify() error {
return err
}
// Example: VMware Fusion e.x.p build-6048684 Release
techPreviewRe := regexp.MustCompile(`(?i)VMware [a-z0-9-]+ e\.x\.p `)
matches := techPreviewRe.FindStringSubmatch(stderr.String())
if matches != nil {
log.Printf("Detected VMware version: e.x.p (Tech Preview)")
return nil
}
// Example: VMware Fusion 7.1.3 build-3204469 Release
versionRe := regexp.MustCompile(`(?i)VMware [a-z0-9-]+ (\d+)\.`)
matches := versionRe.FindStringSubmatch(stderr.String())
matches = versionRe.FindStringSubmatch(stderr.String())
if matches == nil {
return fmt.Errorf(
"Couldn't find VMware version in output: %s", stderr.String())