mirror of https://github.com/hashicorp/packer
parent
0c5ea9aa36
commit
1aa1399e85
@ -1,28 +1,17 @@
|
|||||||
package common
|
package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"github.com/mitchellh/packer/template/interpolate"
|
||||||
"github.com/mitchellh/packer/packer"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type PrlctlPostConfig struct {
|
type PrlctlPostConfig struct {
|
||||||
PrlctlPost [][]string `mapstructure:"prlctl_post"`
|
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 {
|
if c.PrlctlPost == nil {
|
||||||
c.PrlctlPost = make([][]string, 0)
|
c.PrlctlPost = make([][]string, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
errs := make([]error, 0)
|
return nil
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in new issue