Commit a6194467 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/*: Adhere to the new interface

parent 9f5a2475
......@@ -44,11 +44,15 @@ type Builder struct {
runner multistep.Runner
}
func (b *Builder) Prepare(raw interface{}) error {
func (b *Builder) Prepare(raws ...interface{}) error {
var err error
for _, raw := range raws {
err := mapstructure.Decode(raw, &b.config)
if err != nil {
return err
}
}
if b.config.SSHPort == 0 {
b.config.SSHPort = 22
......
......@@ -47,11 +47,15 @@ type config struct {
RawSSHWaitTimeout string `mapstructure:"ssh_wait_timeout"`
}
func (b *Builder) Prepare(raw interface{}) error {
func (b *Builder) Prepare(raws ...interface{}) error {
var err error
if err := mapstructure.Decode(raw, &b.config); err != nil {
for _, raw := range raws {
err := mapstructure.Decode(raw, &b.config)
if err != nil {
return err
}
}
if b.config.GuestOSType == "" {
b.config.GuestOSType = "Other"
......
......@@ -49,10 +49,13 @@ type config struct {
RawSSHWaitTimeout string `mapstructure:"ssh_wait_timeout"`
}
func (b *Builder) Prepare(raw interface{}) error {
if err := mapstructure.Decode(raw, &b.config); err != nil {
func (b *Builder) Prepare(raws ...interface{}) error {
for _, raw := range raws {
err := mapstructure.Decode(raw, &b.config)
if err != nil {
return err
}
}
if b.config.DiskName == "" {
b.config.DiskName = "disk"
......
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