builder/digitalocean: check for err parsing template for snapshot name

This commit is contained in:
Jack Pearkes 2013-06-17 23:54:28 +02:00
parent 5ecd30a75f
commit e62bcefcb8
1 changed files with 4 additions and 1 deletions

View File

@ -134,7 +134,10 @@ func (b *Builder) Prepare(raws ...interface{}) error {
tData := snapshotNameData{
strconv.FormatInt(time.Now().UTC().Unix(), 10),
}
t := template.Must(template.New("snapshot").Parse(b.config.RawSnapshotName))
t, err := template.New("snapshot").Parse(b.config.RawSnapshotName)
if err != nil {
errs = append(errs, fmt.Errorf("Failed parsing snapshot_name: %s", err))
}
t.Execute(snapNameBuf, tData)
b.config.SnapshotName = snapNameBuf.String()