Set export_dir to the output_dir property

This commit is contained in:
Jimmy The Dog 2017-03-10 08:20:48 +00:00
parent 9eb9abdce9
commit e851efb1b6
2 changed files with 5 additions and 8 deletions

8
builder/vmware/iso/builder.go Executable file → Normal file
View File

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

View File

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