Commit 4236ffc8 authored by Jack Pearkes's avatar Jack Pearkes

builder/digitalocean: only execute the snapshotname template if parsed

parent b75daf62
......@@ -137,9 +137,10 @@ func (b *Builder) Prepare(raws ...interface{}) error {
t, err := template.New("snapshot").Parse(b.config.RawSnapshotName)
if err != nil {
errs = append(errs, fmt.Errorf("Failed parsing snapshot_name: %s", err))
} else {
t.Execute(snapNameBuf, tData)
b.config.SnapshotName = snapNameBuf.String()
}
t.Execute(snapNameBuf, tData)
b.config.SnapshotName = snapNameBuf.String()
if len(errs) > 0 {
return &packer.MultiError{errs}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment