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
1 changed files with 5 additions and 1 deletions

View File

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