From e851efb1b6e176176dd6498a310f5e62b0d5f33a Mon Sep 17 00:00:00 2001 From: Jimmy The Dog Date: Fri, 10 Mar 2017 08:20:48 +0000 Subject: [PATCH] Set export_dir to the output_dir property --- builder/vmware/iso/builder.go | 8 ++++---- builder/vmware/iso/step_export.go | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) mode change 100755 => 100644 builder/vmware/iso/builder.go diff --git a/builder/vmware/iso/builder.go b/builder/vmware/iso/builder.go old mode 100755 new mode 100644 index 6eb6a30f1..b01cb1f32 --- a/builder/vmware/iso/builder.go +++ b/builder/vmware/iso/builder.go @@ -201,8 +201,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe dir = new(vmwcommon.LocalOutputDir) } - localDir := localOutputDir{b.config.OutputDir} - log.Printf("b.config.OutputDir: %s, localDir: %s", b.config.OutputDir, localDir.dir) + exportOutputPath := b.config.OutputDir + if b.config.RemoteType != "" && b.config.Format != "" { b.config.OutputDir = b.config.VMName } @@ -214,8 +214,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe state.Put("config", &b.config) state.Put("debug", b.config.PackerDebug) state.Put("dir", dir) - state.Put("localDir", localDir) state.Put("driver", driver) + state.Put("exportPath", exportOutputPath) state.Put("hook", hook) state.Put("ui", ui) @@ -334,7 +334,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe var files []string if b.config.RemoteType != "" && b.config.Format != "" { dir = new(vmwcommon.LocalOutputDir) - dir.SetOutputDir(localDir.dir) + dir.SetOutputDir(exportOutputPath) files, err = dir.ListFiles() } else { files, err = state.Get("dir").(OutputDir).ListFiles() diff --git a/builder/vmware/iso/step_export.go b/builder/vmware/iso/step_export.go index 67a12a570..04c526aae 100644 --- a/builder/vmware/iso/step_export.go +++ b/builder/vmware/iso/step_export.go @@ -60,8 +60,7 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction { } // Export the VM - localDir := state.Get("localDir").(localOutputDir) - outputPath := localDir.dir + outputPath := state.Get("exportPath").(string) if s.Format == "ova" { os.MkdirAll(outputPath, 0755) @@ -81,8 +80,6 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction { ui.Message(fmt.Sprintf("%s", out.String())) - state.Put("exportPath", outputPath) - return multistep.ActionContinue }