Commit 0c7efde1 authored by Timothy Sutton's avatar Timothy Sutton

Remove ISO from ide1 in stepCleanVMX

parent 16d102d0
...@@ -22,9 +22,6 @@ import ( ...@@ -22,9 +22,6 @@ import (
type stepCleanVMX struct{} type stepCleanVMX struct{}
func (s stepCleanVMX) Run(state map[string]interface{}) multistep.StepAction { func (s stepCleanVMX) Run(state map[string]interface{}) multistep.StepAction {
if _, ok := state["floppy_path"]; !ok {
return multistep.ActionContinue
}
ui := state["ui"].(packer.Ui) ui := state["ui"].(packer.Ui)
vmxPath := state["vmx_path"].(string) vmxPath := state["vmx_path"].(string)
...@@ -35,15 +32,22 @@ func (s stepCleanVMX) Run(state map[string]interface{}) multistep.StepAction { ...@@ -35,15 +32,22 @@ func (s stepCleanVMX) Run(state map[string]interface{}) multistep.StepAction {
return multistep.ActionHalt return multistep.ActionHalt
} }
// Delete the floppy0 entries so the floppy is no longer mounted if _, ok := state["floppy_path"]; ok {
ui.Say("Unmounting floppy from VMX...") // Delete the floppy0 entries so the floppy is no longer mounted
for k, _ := range vmxData { ui.Say("Unmounting floppy from VMX...")
if strings.HasPrefix(k, "floppy0.") { for k, _ := range vmxData {
log.Printf("Deleting key: %s", k) if strings.HasPrefix(k, "floppy0.") {
delete(vmxData, k) log.Printf("Deleting key: %s", k)
delete(vmxData, k)
}
} }
vmxData["floppy0.present"] = "FALSE"
} }
vmxData["floppy0.present"] = "FALSE"
// Change the CD-ROM device back to auto-detect, ejecting the iso
ui.Say("Detatching ISO from CD-ROM device...")
vmxData["ide1:0.fileName"] = "auto detect"
vmxData["ide1:0.deviceType"] = "cdrom-raw"
// Rewrite the VMX // Rewrite the VMX
if err := WriteVMX(vmxPath, vmxData); err != nil { if err := WriteVMX(vmxPath, vmxData); err != nil {
......
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