diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-11-16 20:54:28 -0800 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-11-16 20:54:28 -0800 |
commit | fcc0ba7da1caaca7b3f6f7a80630b4cbc227db46 (patch) | |
tree | 0e25eafc22641b11c693eea70725b2f85e78337f /ec2/spark_ec2.py | |
parent | 6adc7c965f35ede8fb09452e278b2f17981ff600 (diff) | |
parent | 6d22f7ccb80f21f0622a3740d8fb3acd66a5b29e (diff) | |
download | spark-fcc0ba7da1caaca7b3f6f7a80630b4cbc227db46.tar.gz spark-fcc0ba7da1caaca7b3f6f7a80630b4cbc227db46.tar.bz2 spark-fcc0ba7da1caaca7b3f6f7a80630b4cbc227db46.zip |
Merge pull request #306 from admobius/master
Delete security groups when destroying cluster
Diffstat (limited to 'ec2/spark_ec2.py')
-rwxr-xr-x | ec2/spark_ec2.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py index 2ca4d8020d..17276db6e5 100755 --- a/ec2/spark_ec2.py +++ b/ec2/spark_ec2.py @@ -509,6 +509,20 @@ def main(): print "Terminating zoo..." for inst in zoo_nodes: inst.terminate() + # Delete security groups as well + group_names = [cluster_name + "-master", cluster_name + "-slaves", cluster_name + "-zoo"] + groups = conn.get_all_security_groups() + for group in groups: + if group.name in group_names: + print "Deleting security group " + group.name + # Delete individual rules before deleting group to remove dependencies + for rule in group.rules: + for grant in rule.grants: + group.revoke(ip_protocol=rule.ip_protocol, + from_port=rule.from_port, + to_port=rule.to_port, + src_group=grant) + conn.delete_security_group(group.name) elif action == "login": (master_nodes, slave_nodes, zoo_nodes) = get_existing_cluster( |