Skip to content

Commit ada993e

Browse files
Vladimir Grigorsrowen
Vladimir Grigor
authored andcommitted
[SPARK-5335] Fix deletion of security groups within a VPC
Please see https://issues.apache.org/jira/browse/SPARK-5335. The fix itself is in e58a8b01a8bedcbfbbc6d04b1c1489255865cf87 commit. Two earlier commits are fixes of another VPC related bug waiting to be merged. I should have created former bug fix in own branch then this fix would not have former fixes. :( This code is released under the project's license. Author: Vladimir Grigor <vladimir@kiosked.com> Author: Vladimir Grigor <vladimir@voukka.com> Closes #4122 from voukka/SPARK-5335_delete_sg_vpc and squashes the following commits: 090dca9 [Vladimir Grigor] fixes as per review: removed printing of group_id and added comment 730ec05 [Vladimir Grigor] fix for SPARK-5335: Destroying cluster in VPC with "--delete-groups" fails to remove security groups
1 parent d5fc514 commit ada993e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ec2/spark_ec2.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,11 +1174,12 @@ def real_main():
11741174
time.sleep(30) # Yes, it does have to be this long :-(
11751175
for group in groups:
11761176
try:
1177-
conn.delete_security_group(group.name)
1178-
print "Deleted security group " + group.name
1177+
# It is needed to use group_id to make it work with VPC
1178+
conn.delete_security_group(group_id=group.id)
1179+
print "Deleted security group %s" % group.name
11791180
except boto.exception.EC2ResponseError:
11801181
success = False
1181-
print "Failed to delete security group " + group.name
1182+
print "Failed to delete security group %s" % group.name
11821183

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

0 commit comments

Comments
 (0)