Commit de5c38e6 authored by StefanScherer's avatar StefanScherer

skip adding floppy again in vmx_data_post step

parent 1dcaf171
......@@ -18,6 +18,7 @@ import (
// vmx_path string
type StepConfigureVMX struct {
CustomData map[string]string
SkipFloppy bool
}
func (s *StepConfigureVMX) Run(state multistep.StateBag) multistep.StepAction {
......@@ -56,12 +57,15 @@ func (s *StepConfigureVMX) Run(state multistep.StateBag) multistep.StepAction {
vmxData[k] = v
}
// 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)
// Set a floppy disk, but only if we should
if ! s.SkipFloppy {
// 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)
}
}
if err := WriteVMX(vmxPath, vmxData); err != nil {
......
......@@ -370,6 +370,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&vmwcommon.StepCleanVMX{},
&vmwcommon.StepConfigureVMX{
CustomData: b.config.VMXDataPost,
SkipFloppy: true,
},
&vmwcommon.StepCompactDisk{
Skip: b.config.SkipCompaction,
......
......@@ -97,6 +97,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
&vmwcommon.StepCleanVMX{},
&vmwcommon.StepConfigureVMX{
CustomData: b.config.VMXDataPost,
SkipFloppy: true,
},
&vmwcommon.StepCompactDisk{
Skip: b.config.SkipCompaction,
......
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