Fix #2717, Driver vmwarefusion fail because of soft link

Signed-off-by: rediceli <redice.li@qq.com>
This commit is contained in:
rediceli 2016-01-02 00:33:47 +08:00
parent 626bd0df89
commit ccb8c31827
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"
@ -200,7 +201,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