packer: delete pause_before to avoid template invalids [GH-759]
This commit is contained in:
parent
02bb5b0a97
commit
b5f1fd1423
|
@ -317,6 +317,10 @@ func ParseTemplate(data []byte, vars map[string]string) (t *Template, err error)
|
||||||
raw.pauseBefore = duration
|
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
|
raw.RawConfig = v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1479,6 +1479,11 @@ func TestTemplateBuild_ProvisionerPauseBefore(t *testing.T) {
|
||||||
t.Fatalf("bad: %#v", pp.PauseBefore)
|
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) {
|
func TestTemplateBuild_variables(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue