From 9fc412714c038f69f959105e1f5dc8e8a670d0b9 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Wed, 18 Apr 2018 10:37:40 +0200 Subject: Track the indirectly created security groups networking-odl creates a security group when creating a router. This security group is not tracked by SNAPs and thus it never gets removed when running the clean up. We need this workaround until the following bug is fixed: https://bugs.launchpad.net/networking-odl/+bug/1763705 Change-Id: I15b939609e815f24ef0c1dcc0aeb9f4471f351f0 Signed-off-by: Manuel Buil --- sfc/lib/openstack_utils.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sfc/lib/openstack_utils.py') diff --git a/sfc/lib/openstack_utils.py b/sfc/lib/openstack_utils.py index b7254bf1..0b343f37 100644 --- a/sfc/lib/openstack_utils.py +++ b/sfc/lib/openstack_utils.py @@ -253,10 +253,19 @@ class OpenStackSFC: " with name {1}".format(vm.name, port_name)) raise Exception("Client VM does not have the desired port") + def delete_all_security_groups(self): + ''' + Deletes all the available security groups -# TACKER SECTION # + Needed until this bug is fixed: + https://bugs.launchpad.net/networking-odl/+bug/1763705 + ''' + sec_groups = neutron_utils.list_security_groups(self.neutron) + for sg in sec_groups: + neutron_utils.delete_security_group(self.neutron, sg) +# TACKER SECTION # def get_tacker_client_version(): api_version = os.getenv('OS_TACKER_API_VERSION') if api_version is not None: -- cgit 1.2.3-korg