builder/amazon/common: correct logic in deleting secutiry group

This commit is contained in:
Mitchell Hashimoto 2013-08-12 13:43:52 -07:00
parent 48b9da2feb
commit 7cc9aa36ff
1 changed files with 5 additions and 4 deletions

View File

@ -88,11 +88,12 @@ func (s *StepSecurityGroup) Cleanup(state map[string]interface{}) {
var err error
for i := 0; i < 5; i++ {
_, err = ec2conn.DeleteSecurityGroup(ec2.SecurityGroup{Id: s.createdGroupId})
if err != nil {
log.Printf("Error deleting security group: %s", err)
time.Sleep(5 * time.Second)
continue
if err == nil {
break
}
log.Printf("Error deleting security group: %s", err)
time.Sleep(5 * time.Second)
}
if err != nil {