Skip to content
Snippets Groups Projects
Commit fcc0ba7d authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Merge pull request #306 from admobius/master

Delete security groups when destroying cluster
parents 6adc7c96 6d22f7cc
No related branches found
No related tags found
No related merge requests found
...@@ -509,6 +509,20 @@ def main(): ...@@ -509,6 +509,20 @@ def main():
print "Terminating zoo..." print "Terminating zoo..."
for inst in zoo_nodes: for inst in zoo_nodes:
inst.terminate() 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": elif action == "login":
(master_nodes, slave_nodes, zoo_nodes) = get_existing_cluster( (master_nodes, slave_nodes, zoo_nodes) = get_existing_cluster(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment