builder/digitalocean: only execute the snapshotname template if parsed
This commit is contained in:
parent
b75daf62ff
commit
4236ffc8eb
|
@ -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()
|
||||
}
|
||||
|
||||
if len(errs) > 0 {
|
||||
return &packer.MultiError{errs}
|
||||
|
|
Loading…
Reference in New Issue