From: Tony Mack Date: Thu, 15 Mar 2012 17:14:51 +0000 (-0400) Subject: delete_instnaces() also deletes any security groups associated with the instance X-Git-Tag: sfa-2.1-4~48 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f1f5784b99be371667be87e554a2d304a1beac45;p=sfa.git delete_instnaces() also deletes any security groups associated with the instance --- diff --git a/sfa/openstack/osaggregate.py b/sfa/openstack/osaggregate.py index 8c2bf43d..50d1443b 100644 --- a/sfa/openstack/osaggregate.py +++ b/sfa/openstack/osaggregate.py @@ -263,7 +263,12 @@ class OSAggregate: if not project: return 1 instances = self.driver.shell.db.instance_get_all_by_project(project_name) + security_group_manager = SecurityGroup(self) for instance in instances: + # deleate this instance's security groups + for security_group in instance.security_groups: + security_group_manager.delete_security_group(security_group.name) + # destroy instance self.driver.shell.db.instance_destroy(instance.instance_id) return 1