This commit is contained in:
Adrien Delorme 2019-12-17 16:31:22 +01:00
parent 4b7132c87c
commit 50fb1148b4
2 changed files with 5 additions and 4 deletions

View File

@ -40,8 +40,8 @@ var _ packer.Builder = new(MockBuilder)
func (b *MockBuilder) ConfigSpec() hcldec.ObjectSpec { return b.Config.FlatMapstructure().HCL2Spec() } func (b *MockBuilder) ConfigSpec() hcldec.ObjectSpec { return b.Config.FlatMapstructure().HCL2Spec() }
func (b *MockBuilder) Prepare(raws ...interface{}) ([]string, error) { func (b *MockBuilder) Prepare(raws ...interface{}) ([]string, []string, error) {
return nil, config.Decode(&b.Config, &config.DecodeOpts{ return nil, nil, config.Decode(&b.Config, &config.DecodeOpts{
Interpolate: true, Interpolate: true,
}, raws...) }, raws...)
} }
@ -70,7 +70,7 @@ func (b *MockProvisioner) Prepare(raws ...interface{}) error {
}, raws...) }, raws...)
} }
func (b *MockProvisioner) Provision(ctx context.Context, ui packer.Ui, comm packer.Communicator) error { func (b *MockProvisioner) Provision(ctx context.Context, ui packer.Ui, comm packer.Communicator, _ map[string]interface{}) error {
return nil return nil
} }

View File

@ -61,7 +61,8 @@ func (p *Parser) StartBuilder(source *Source) (packer.Builder, hcl.Diagnostics)
if moreDiags.HasErrors() { if moreDiags.HasErrors() {
return nil, diags return nil, diags
} }
warning, err := builder.Prepare(decoded)
_, warning, err := builder.Prepare(decoded)
moreDiags = warningErrorsToDiags(source.block, warning, err) moreDiags = warningErrorsToDiags(source.block, warning, err)
diags = append(diags, moreDiags...) diags = append(diags, moreDiags...)
return builder, diags return builder, diags