diff --git a/builder/vmware/common/step_clean_vmx.go b/builder/vmware/common/step_clean_vmx.go index b55bcd549..9c677e3a8 100644 --- a/builder/vmware/common/step_clean_vmx.go +++ b/builder/vmware/common/step_clean_vmx.go @@ -32,17 +32,15 @@ func (s StepCleanVMX) Run(state multistep.StateBag) multistep.StepAction { return multistep.ActionHalt } - if _, ok := state.GetOk("floppy_path"); ok { - // Delete the floppy0 entries so the floppy is no longer mounted - ui.Message("Unmounting floppy from VMX...") - for k, _ := range vmxData { - if strings.HasPrefix(k, "floppy0.") { - log.Printf("Deleting key: %s", k) - delete(vmxData, k) - } + // Delete the floppy0 entries so the floppy is no longer mounted + ui.Message("Unmounting floppy from VMX...") + for k, _ := range vmxData { + if strings.HasPrefix(k, "floppy0.") { + log.Printf("Deleting key: %s", k) + delete(vmxData, k) } - vmxData["floppy0.present"] = "FALSE" } + vmxData["floppy0.present"] = "FALSE" if isoPathRaw, ok := state.GetOk("iso_path"); ok { isoPath := isoPathRaw.(string) diff --git a/builder/vmware/common/step_clean_vmx_test.go b/builder/vmware/common/step_clean_vmx_test.go index 59877027a..73a8abf45 100644 --- a/builder/vmware/common/step_clean_vmx_test.go +++ b/builder/vmware/common/step_clean_vmx_test.go @@ -39,7 +39,6 @@ func TestStepCleanVMX_floppyPath(t *testing.T) { t.Fatalf("err: %s", err) } - state.Put("floppy_path", "foo") state.Put("vmx_path", vmxPath) // Test the run