From 7a2b30dcc44107560c89421fa4f1774b90e768ff Mon Sep 17 00:00:00 2001 From: Jimmy The Dog Date: Fri, 24 Feb 2017 13:18:28 +0000 Subject: [PATCH] builder/vmware-iso: need to always set local output dir, or non-remote build exports will fail --- builder/vmware/iso/builder.go | 4 ++-- builder/vmware/iso/step_export.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/vmware/iso/builder.go b/builder/vmware/iso/builder.go index 6f512ac82..163d90184 100755 --- a/builder/vmware/iso/builder.go +++ b/builder/vmware/iso/builder.go @@ -200,9 +200,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe dir = new(vmwcommon.LocalOutputDir) } - var localDir localOutputDir + localDir := localOutputDir{b.config.OutputDir} + log.Printf("b.config.OutputDir: %s, localDir: %s", b.config.OutputDir, localDir.dir) if b.config.RemoteType != "" && b.config.Format != "" { - localDir = localOutputDir{b.config.OutputDir} b.config.OutputDir = b.config.VMName } dir.SetOutputDir(b.config.OutputDir) diff --git a/builder/vmware/iso/step_export.go b/builder/vmware/iso/step_export.go index b7fcbd24c..c3ba3024a 100644 --- a/builder/vmware/iso/step_export.go +++ b/builder/vmware/iso/step_export.go @@ -60,7 +60,7 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction { // Export the VM localDir := state.Get("localDir").(localOutputDir) - outputPath := filepath.Join(fmt.Sprintf("%v", localDir), c.VMName+"."+s.Format) + outputPath := filepath.Join(localDir.dir, c.VMName+"."+s.Format) if s.Format == "ova" { os.MkdirAll(outputPath, 0755)