|
|
|
|
@ -38,8 +38,7 @@ type Config struct {
|
|
|
|
|
ctx interpolate.Context
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewConfig(raws ...interface{}) (*Config, []string, error) {
|
|
|
|
|
c := new(Config)
|
|
|
|
|
func (c *Config) Prepare(raws ...interface{}) ([]string, error) {
|
|
|
|
|
err := config.Decode(c, &config.DecodeOpts{
|
|
|
|
|
Interpolate: true,
|
|
|
|
|
InterpolateContext: &c.ctx,
|
|
|
|
|
@ -50,7 +49,7 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
|
|
|
|
|
},
|
|
|
|
|
}, raws...)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, nil, err
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
warnings := make([]string, 0)
|
|
|
|
|
@ -75,8 +74,8 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) {
|
|
|
|
|
errs = packer.MultiErrorAppend(errs, c.ShutdownConfig.Prepare()...)
|
|
|
|
|
|
|
|
|
|
if len(errs.Errors) > 0 {
|
|
|
|
|
return nil, nil, errs
|
|
|
|
|
return nil, errs
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return c, nil, nil
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|
|
|
|
|
|