Skip to content

Commit d24971a

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 (cherry picked from commit ada993e) Signed-off-by: Sean Owen <sowen@cloudera.com>
1 parent c7bac57 commit d24971a

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
@@ -983,11 +983,12 @@ def real_main():
983983
time.sleep(30) # Yes, it does have to be this long :-(
984984
for group in groups:
985985
try:
986-
conn.delete_security_group(group.name)
987-
print "Deleted security group " + group.name
986+
# It is needed to use group_id to make it work with VPC
987+
conn.delete_security_group(group_id=group.id)
988+
print "Deleted security group %s" % group.name
988989
except boto.exception.EC2ResponseError:
989990
success = False
990-
print "Failed to delete security group " + group.name
991+
print "Failed to delete security group %s" % group.name
991992

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

0 commit comments

Comments
 (0)