builder/amazonebs: check for err parsing template for ami name

This commit is contained in:
Jack Pearkes 2013-06-17 23:55:08 +02:00
parent e62bcefcb8
commit b75daf62ff
1 changed files with 5 additions and 1 deletions

View File

@ -29,7 +29,11 @@ func (s *stepCreateAMI) Run(state map[string]interface{}) multistep.StepAction {
strconv.FormatInt(time.Now().UTC().Unix(), 10), 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) t.Execute(amiNameBuf, tData)
amiName := amiNameBuf.String() amiName := amiNameBuf.String()