Commit cf731bf6 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/vmware: no error if stopping already stopped [GH-1300]

parent b9f82ef1
......@@ -76,6 +76,8 @@ BUG FIXES:
with a zero exit code. [GH-1119]
* builder/virtualbox/iso: Append timestamp to default name for parallel
builds. [GH-1365]
* builder/vmware/all: No more error when Packer stops an already-stopped
VM. [GH-1300]
* builder/vmware/all: `ssh_host` accepts templates. [GH-1396]
* builder/vmware/all: Don't remount floppy in VMX post step. [GH-1239]
* builder/vmware/vmx: Do not re-add floppy disk files to VMX [GH-1361]
......
......@@ -90,6 +90,12 @@ func (d *Fusion5Driver) Start(vmxPath string, headless bool) error {
func (d *Fusion5Driver) Stop(vmxPath string) error {
cmd := exec.Command(d.vmrunPath(), "-T", "fusion", "stop", vmxPath, "hard")
if _, _, err := runAndLog(cmd); err != nil {
// Check if the VM is running. If its not, it was already stopped
running, rerr := d.IsRunning(vmxPath)
if rerr == nil && !running {
return nil
}
return err
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment