packer: better error message for bad provisioner only/except

This commit is contained in:
Mitchell Hashimoto 2013-09-20 11:26:56 -07:00
parent 15b48bb71e
commit 5c02bd3d26
1 changed files with 4 additions and 1 deletions

View File

@ -273,7 +273,10 @@ func ParseTemplate(data []byte) (t *Template, err error) {
// Verify that the only settings are good
if errs := raw.TemplateOnlyExcept.Validate(t.Builders); len(errs) > 0 {
errors = append(errors, errs...)
for _, err := range errs {
errors = append(errors,
fmt.Errorf("provisioner %d: %s", i+1, err))
}
}
raw.RawConfig = v