From 1a6f41025708f89f78b959ac21af34571eccb8f6 Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Mon, 17 Jun 2013 23:54:28 +0200 Subject: [PATCH] builder/digitalocean: check for err parsing template for snapshot name --- builder/digitalocean/builder.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builder/digitalocean/builder.go b/builder/digitalocean/builder.go index d8469d752..447266090 100644 --- a/builder/digitalocean/builder.go +++ b/builder/digitalocean/builder.go @@ -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()