Set export_dir to the output_dir property
This commit is contained in:
parent
9eb9abdce9
commit
e851efb1b6
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue