mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-20 06:51:39 -04:00
builder/digitalocean: only execute the snapshotname template if parsed
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user