Skip to content

Commit 5c9db4e

Browse files
Vladimir Grigorsrowen
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 f7103b3 commit 5c9db4e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

ec2/spark_ec2.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,11 +1100,12 @@ def real_main():
11001100
time.sleep(30) # Yes, it does have to be this long :-(
11011101
for group in groups:
11021102
try:
1103-
conn.delete_security_group(group.name)
1104-
print "Deleted security group " + group.name
1103+
# It is needed to use group_id to make it work with VPC
1104+
conn.delete_security_group(group_id=group.id)
1105+
print "Deleted security group %s" % group.name
11051106
except boto.exception.EC2ResponseError:
11061107
success = False
1107-
print "Failed to delete security group " + group.name
1108+
print "Failed to delete security group %s" % group.name
11081109

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

0 commit comments

Comments
 (0)