post-processor/vagrant: properly forward config into provider [GH-129]
This commit is contained in:
parent
534c923a44
commit
f5003c4e19
|
@ -10,6 +10,11 @@ IMPROVEMENTS:
|
||||||
* virtualbox: Delete the packer-made SSH port forwarding prior to
|
* virtualbox: Delete the packer-made SSH port forwarding prior to
|
||||||
exporting the VM.
|
exporting the VM.
|
||||||
|
|
||||||
|
BUG FIXES:
|
||||||
|
|
||||||
|
* vagrant: Properly configure the provider-specific post-processors so
|
||||||
|
things like `vagrantfile_template` work. [GH-129]
|
||||||
|
|
||||||
## 0.1.4 (July 2, 2013)
|
## 0.1.4 (July 2, 2013)
|
||||||
|
|
||||||
FEATURES:
|
FEATURES:
|
||||||
|
|
|
@ -26,9 +26,13 @@ type Config struct {
|
||||||
type PostProcessor struct {
|
type PostProcessor struct {
|
||||||
config Config
|
config Config
|
||||||
premade map[string]packer.PostProcessor
|
premade map[string]packer.PostProcessor
|
||||||
|
rawConfigs []interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||||
|
// Store the raw configs for usage later
|
||||||
|
p.rawConfigs = raws
|
||||||
|
|
||||||
for _, raw := range raws {
|
for _, raw := range raws {
|
||||||
err := mapstructure.Decode(raw, &p.config)
|
err := mapstructure.Decode(raw, &p.config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -93,8 +97,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
|
||||||
return nil, false, fmt.Errorf("Vagrant box post-processor not found: %s", ppName)
|
return nil, false, fmt.Errorf("Vagrant box post-processor not found: %s", ppName)
|
||||||
}
|
}
|
||||||
|
|
||||||
config := map[string]string{"output": p.config.OutputPath}
|
if err := pp.Configure(p.rawConfigs...); err != nil {
|
||||||
if err := pp.Configure(config); err != nil {
|
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue