Commit a6194467 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/*: Adhere to the new interface

parent 9f5a2475
......@@ -44,10 +44,14 @@ type Builder struct {
runner multistep.Runner
}
func (b *Builder) Prepare(raw interface{}) error {
err := mapstructure.Decode(raw, &b.config)
if err != nil {
return err
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 {
......
......@@ -47,10 +47,14 @@ 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 {
return err
for _, raw := range raws {
err := mapstructure.Decode(raw, &b.config)
if err != nil {
return err
}
}
if b.config.GuestOSType == "" {
......
......@@ -49,9 +49,12 @@ 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 {
return err
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 == "" {
......
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