Commit 12ad2cf9 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer: verify `except` has valid builders [GH-438]

parent a31a4207
......@@ -563,5 +563,12 @@ func (t *TemplateOnlyExcept) Validate(b map[string]RawBuilderConfig) (e []error)
}
}
for _, n := range t.Except {
if _, ok := b[n]; !ok {
e = append(e,
fmt.Errorf("'except' specified builder '%s' not found", n))
}
}
return
}
......@@ -707,7 +707,7 @@ func TestTemplateBuild_exeptPPInvalid(t *testing.T) {
"post-processors": [
{
"type": "test-pp",
"except": "test5"
"except": ["test5"]
}
]
}
......@@ -787,7 +787,7 @@ func TestTemplateBuild_exceptProvInvalid(t *testing.T) {
"provisioners": [
{
"type": "test-prov",
"except": "test5"
"except": ["test5"]
}
]
}
......@@ -867,7 +867,7 @@ func TestTemplateBuild_onlyPPInvalid(t *testing.T) {
"post-processors": [
{
"type": "test-pp",
"only": "test5"
"only": ["test5"]
}
]
}
......@@ -947,7 +947,7 @@ func TestTemplateBuild_onlyProvInvalid(t *testing.T) {
"provisioners": [
{
"type": "test-prov",
"only": "test5"
"only": ["test5"]
}
]
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment