Merge pull request #2721 from rediceli/master

Fix #2717, Driver vmwarefusion fail because of soft link
This commit is contained in:
Jean-Laurent de Morlhon 2016-01-04 17:34:01 +01:00
commit 42b1f4e811
1 changed files with 6 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import (
"io/ioutil"
"net"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
@ -198,7 +199,11 @@ func (d *Driver) GetIP() (string, error) {
func (d *Driver) GetState() (state.State, error) {
// VMRUN only tells use if the vm is running or not
if stdout, _, _ := vmrun("list"); strings.Contains(stdout, d.vmxPath()) {
vmxp, err := filepath.EvalSymlinks(d.vmxPath())
if err != nil {
return state.Error, err
}
if stdout, _, _ := vmrun("list"); strings.Contains(stdout, vmxp) {
return state.Running, nil
}
return state.Stopped, nil