builder/digitalocean: Adhere to new interface, make default in Packer

@pearkes: I added "digital-ocean" to the default config since it will
be shipping with Packer. :)
This commit is contained in:
Mitchell Hashimoto 2013-06-15 11:06:39 -07:00
parent a76a9e86fc
commit 03d7a7f6b5
3 changed files with 8 additions and 4 deletions

View File

@ -42,9 +42,12 @@ type Builder struct {
runner multistep.Runner
}
func (b *Builder) Prepare(raw interface{}) error {
if err := mapstructure.Decode(raw, &b.config); err != nil {
return err
func (b *Builder) Prepare(raws ...interface{}) error {
for _, raw := range raws {
err := mapstructure.Decode(raw, &b.config)
if err != nil {
return err
}
}
// Optional configuration with defaults

View File

@ -18,6 +18,7 @@ const defaultConfig = `
"builders": {
"amazon-ebs": "packer-builder-amazon-ebs",
"digital-ocean": "packer-builder-digital-ocean",
"virtualbox": "packer-builder-virtualbox",
"vmware": "packer-builder-vmware"
},

View File

@ -2,7 +2,7 @@ package main
import (
"github.com/mitchellh/packer/packer/plugin"
"github.com/pearkes/packer/builder/digitalocean"
"github.com/mitchellh/packer/builder/digitalocean"
)
func main() {