mirror of https://github.com/hashicorp/packer
parent
0c5ea9aa36
commit
1aa1399e85
@ -1,28 +1,17 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/mitchellh/packer/packer"
|
||||
"github.com/mitchellh/packer/template/interpolate"
|
||||
)
|
||||
|
||||
type PrlctlPostConfig struct {
|
||||
PrlctlPost [][]string `mapstructure:"prlctl_post"`
|
||||
}
|
||||
|
||||
func (c *PrlctlPostConfig) Prepare(t *packer.ConfigTemplate) []error {
|
||||
func (c *PrlctlPostConfig) Prepare(ctx *interpolate.Context) []error {
|
||||
if c.PrlctlPost == nil {
|
||||
c.PrlctlPost = make([][]string, 0)
|
||||
}
|
||||
|
||||
errs := make([]error, 0)
|
||||
for i, args := range c.PrlctlPost {
|
||||
for j, arg := range args {
|
||||
if err := t.Validate(arg); err != nil {
|
||||
errs = append(errs,
|
||||
fmt.Errorf("Error processing prlctl_post[%d][%d]: %s", i, j, err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return errs
|
||||
return nil
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue