builder/vmware-iso: need to always set local output dir, or non-remote build exports will fail

This commit is contained in:
Jimmy The Dog 2017-02-24 13:18:28 +00:00
parent f8df5f81db
commit 7a2b30dcc4
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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)