builder/*: Adhere to the new interface

This commit is contained in:
Mitchell Hashimoto 2013-06-14 12:29:48 -07:00
parent 9f5a247511
commit a6194467ac
3 changed files with 21 additions and 10 deletions

View File

@ -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 {

View File

@ -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 == "" {

View File

@ -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 == "" {