Repository: spark
Updated Branches:
  refs/heads/branch-1.3 f7103b343 -> 5c9db4e75


[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 <vladi...@kiosked.com>
Author: Vladimir Grigor <vladi...@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 ada993e954e2825c0fe13326fc23b0e1a567cd55)
Signed-off-by: Sean Owen <so...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/5c9db4e7
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/5c9db4e7
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/5c9db4e7

Branch: refs/heads/branch-1.3
Commit: 5c9db4e756b9f5567d9510e614ac399fbd68246a
Parents: f7103b3
Author: Vladimir Grigor <vladi...@kiosked.com>
Authored: Thu Feb 12 23:26:24 2015 +0000
Committer: Sean Owen <so...@cloudera.com>
Committed: Thu Feb 12 23:26:35 2015 +0000

----------------------------------------------------------------------
 ec2/spark_ec2.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/5c9db4e7/ec2/spark_ec2.py
----------------------------------------------------------------------
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index 2ac4b3b..c0f3759 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -1100,11 +1100,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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to