Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ec2/spark_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,11 +1082,12 @@ def real_main():
time.sleep(30) # Yes, it does have to be this long :-(
for group in groups:
try:
conn.delete_security_group(group.name)
print "Deleted security group " + group.name
# It is needed to use group_id to make it work with VPC
conn.delete_security_group(group_id=group.id)
print "Deleted security group %s" % group.name
except boto.exception.EC2ResponseError:
success = False
print "Failed to delete security group " + group.name
print "Failed to delete security group %s" % group.name

# Unfortunately, group.revoke() returns True even if a rule was not
# deleted, so this needs to be rerun if something fails
Expand Down