Help ensure VMX builder properly removes mounted CDs on OS X

Pull request 1504 describes a workaround for a potential race condition in which the VMX builder can fail to remove mounted floppies or CDs. This workaround was enabled for all operating systems except OS X. Since this issue can also occur on OS X, also apply the workaround on it.
This commit is contained in:
Bryon Ross 2017-04-19 16:02:40 -07:00
parent 3608d81319
commit d092044834
1 changed files with 3 additions and 4 deletions

View File

@ -8,7 +8,6 @@ import (
"github.com/mitchellh/multistep"
"log"
"regexp"
"runtime"
"strings"
"time"
)
@ -125,10 +124,10 @@ LockWaitLoop:
}
}
if runtime.GOOS != "darwin" && !s.Testing {
if !s.Testing {
// Windows takes a while to yield control of the files when the
// process is exiting. Ubuntu will yield control of the files but
// VMWare may overwrite the VMX cleanup steps that run after this,
// process is exiting. Ubuntu and OS X will yield control of the files
// but VMWare may overwrite the VMX cleanup steps that run after this,
// so we wait to ensure VMWare has exited and flushed the VMX.
// We just sleep here. In the future, it'd be nice to find a better