Commit 8e46cd5c authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

post-processor/vagrant: provider-specific config works

parent f035b7a0
......@@ -41,13 +41,12 @@ func (p *PostProcessor) Configure(raw interface{}) error {
return fmt.Errorf("output invalid template: %s", err)
}
/*
TODO(mitchellh): We need a way to get the keys...
mapConfig, ok := raw.(map[string]interface{})
if !ok {
panic("Raw configuration not a map")
var mapConfig map[string]interface{}
if err := mapstructure.Decode(raw, &mapConfig); err != nil {
return err
}
p.premade = make(map[string]packer.PostProcessor)
errors := make([]error, 0)
for k, raw := range mapConfig {
pp := keyToPostProcessor(k)
......@@ -65,7 +64,6 @@ func (p *PostProcessor) Configure(raw interface{}) error {
if len(errors) > 0 {
return &packer.MultiError{errors}
}
*/
return nil
}
......
......@@ -35,3 +35,15 @@ func TestBuilderPrepare_OutputPath(t *testing.T) {
t.Fatal("should have error")
}
}
func TestBuilderPrepare_PPConfig(t *testing.T) {
var p PostProcessor
// Default
c := testConfig()
c["aws"] = map[string]interface{}{}
err := p.Configure(c)
if err != nil {
t.Fatalf("err: %s", err)
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment