From 0f64704725e3a844337f88404beba397482d2a58 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 18 Sep 2013 14:51:51 -0700 Subject: [PATCH] post-processor/vagrant: set output path always in a new raw --- post-processor/vagrant/post-processor.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/post-processor/vagrant/post-processor.go b/post-processor/vagrant/post-processor.go index ecfae80de..e6f629068 100644 --- a/post-processor/vagrant/post-processor.go +++ b/post-processor/vagrant/post-processor.go @@ -45,10 +45,8 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { tpl.UserVars = p.config.PackerUserVars // Defaults - ppExtraConfig := make(map[string]interface{}) if p.config.OutputPath == "" { p.config.OutputPath = "packer_{{ .BuildName }}_{{.Provider}}.box" - ppExtraConfig["output"] = p.config.OutputPath } // Accumulate any errors @@ -58,10 +56,16 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { errs, fmt.Errorf("Error parsing output template: %s", err)) } + // Store extra configuration we'll send to each post-processor type + ppExtraConfig := make(map[string]interface{}) + ppExtraConfig["output"] = p.config.OutputPath + // Store the extra configuration for post-processors p.rawConfigs = append(p.rawConfigs, ppExtraConfig) - // TODO(mitchellh): Properly handle multiple raw configs + // TODO(mitchellh): Properly handle multiple raw configs. This isn't + // very pressing at the moment because at the time of this comment + // only the first member of raws can contain the actual type-overrides. var mapConfig map[string]interface{} if err := mapstructure.Decode(raws[0], &mapConfig); err != nil { errs = packer.MultiErrorAppend(errs,