From 3512c3c5eaacad21a9130331c9e8f3fe36af4716 Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Mon, 3 Dec 2018 17:44:23 -0600 Subject: [PATCH] Updated StepConfigureVMX to add the floppy disk device to the "temporaryDevices" statebag so that StepCleanVMX can remove it later. --- builder/vmware/common/step_configure_vmx.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/builder/vmware/common/step_configure_vmx.go b/builder/vmware/common/step_configure_vmx.go index 73f0d60fb..a4ebd7ae6 100644 --- a/builder/vmware/common/step_configure_vmx.go +++ b/builder/vmware/common/step_configure_vmx.go @@ -65,13 +65,22 @@ func (s *StepConfigureVMX) Run(_ context.Context, state multistep.StateBag) mult // Set a floppy disk, but only if we should if !s.SkipFloppy { + // Grab list of temporary builder devices so we can append the floppy to it + tmpBuildDevices := state.Get("temporaryDevices").([]string) + // Set a floppy disk if we have one if floppyPathRaw, ok := state.GetOk("floppy_path"); ok { log.Println("Floppy path present, setting in VMX") vmxData["floppy0.present"] = "TRUE" vmxData["floppy0.filetype"] = "file" vmxData["floppy0.filename"] = floppyPathRaw.(string) + + // Add it to our list of build devices to later remove + tmpBuildDevices = append(tmpBuildDevices, "floppy0") } + + // Build the list back in our statebag + state.Put("temporaryDevices", tmpBuildDevices) } // If the build is taking place on a remote ESX server, the displayName