From b75daf62ff6cbe41522ea5feb6b573851d01a14c Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Mon, 17 Jun 2013 23:55:08 +0200 Subject: [PATCH] builder/amazonebs: check for err parsing template for ami name --- builder/amazonebs/step_create_ami.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builder/amazonebs/step_create_ami.go b/builder/amazonebs/step_create_ami.go index f088e8fc6..ae470cb61 100644 --- a/builder/amazonebs/step_create_ami.go +++ b/builder/amazonebs/step_create_ami.go @@ -29,7 +29,11 @@ func (s *stepCreateAMI) Run(state map[string]interface{}) multistep.StepAction { strconv.FormatInt(time.Now().UTC().Unix(), 10), } - t := template.Must(template.New("ami").Parse(config.AMIName)) + t, err := template.New("ami").Parse(config.AMIName) + if err != nil { + ui.Error(err.Error()) + return multistep.ActionHalt + } t.Execute(amiNameBuf, tData) amiName := amiNameBuf.String()