builder/amazon: crash on tagging snapshot when snapshot_tags is unset

Closes #4238
pull/4239/head
Rickard von Essen 10 years ago
parent c2512d232a
commit 8d2ceea5f1

@ -96,10 +96,12 @@ func (s *StepCreateTags) Run(state multistep.StateBag) multistep.StepAction {
}
// Override tags on snapshots
_, err = regionconn.CreateTags(&ec2.CreateTagsInput{
Resources: snapshotIds,
Tags: snapshotTags,
})
if len(snapshotTags) > 0 {
_, err = regionconn.CreateTags(&ec2.CreateTagsInput{
Resources: snapshotIds,
Tags: snapshotTags,
})
}
if err == nil {
return true, nil
}

Loading…
Cancel
Save