packer: delete pause_before to avoid template invalids [GH-759]

This commit is contained in:
Mitchell Hashimoto 2013-12-27 09:52:40 -07:00
parent 02bb5b0a97
commit b5f1fd1423
2 changed files with 9 additions and 0 deletions

View File

@ -317,6 +317,10 @@ func ParseTemplate(data []byte, vars map[string]string) (t *Template, err error)
raw.pauseBefore = duration
}
// Remove the pause_before setting if it is there so that we don't
// get template validation errors later.
delete(v, "pause_before")
raw.RawConfig = v
}

View File

@ -1479,6 +1479,11 @@ func TestTemplateBuild_ProvisionerPauseBefore(t *testing.T) {
t.Fatalf("bad: %#v", pp.PauseBefore)
}
}
config := coreBuild.provisioners[0].config[0].(map[string]interface{})
if _, ok := config["pause_before"]; ok {
t.Fatal("pause_before should be removed")
}
}
func TestTemplateBuild_variables(t *testing.T) {