builder/amazonebs: If only one error on destroy, just return it

This commit is contained in:
Mitchell Hashimoto 2013-06-18 16:25:35 -07:00
parent 13a27deea1
commit 0ac538dc31

View File

@ -53,7 +53,11 @@ func (a *artifact) Destroy() error {
} }
if len(errors) > 0 { if len(errors) > 0 {
return &packer.MultiError{errors} if len(errors) == 1 {
return errors[0]
} else {
return &packer.MultiError{errors}
}
} }
return nil return nil