builder/vmware: sleep before cleaning files on Windows
This commit is contained in:
parent
d76b7e8c36
commit
54adabfd39
|
@ -8,6 +8,7 @@ import (
|
||||||
"github.com/mitchellh/packer/packer"
|
"github.com/mitchellh/packer/packer"
|
||||||
"log"
|
"log"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -120,6 +121,13 @@ LockWaitLoop:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
// Windows takes a while to yield control of the files when the
|
||||||
|
// process is exiting. We just sleep here. In the future, it'd be
|
||||||
|
// nice to find a better solution to this.
|
||||||
|
time.Sleep(5 * time.Second)
|
||||||
|
}
|
||||||
|
|
||||||
log.Println("VM shut down.")
|
log.Println("VM shut down.")
|
||||||
return multistep.ActionContinue
|
return multistep.ActionContinue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue