aboutsummaryrefslogtreecommitdiffstats
path: root/sfc/lib/cleanup.py
diff options
context:
space:
mode:
Diffstat (limited to 'sfc/lib/cleanup.py')
-rw-r--r--sfc/lib/cleanup.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/sfc/lib/cleanup.py b/sfc/lib/cleanup.py
index 32835fa8..e614867d 100644
--- a/sfc/lib/cleanup.py
+++ b/sfc/lib/cleanup.py
@@ -1,6 +1,6 @@
+import logging
import sys
import time
-import logging
import sfc.lib.openstack_utils as os_sfc_utils
import sfc.lib.odl_utils as odl_utils
@@ -82,6 +82,13 @@ def delete_openstack_objects(creators):
logger.error('Unexpected error cleaning - %s', e)
+# Networking-odl generates a new security group when creating a router
+# which is not tracked by SNAPs
+def delete_untracked_security_groups():
+ openstack_sfc = os_sfc_utils.OpenStackSFC()
+ openstack_sfc.delete_all_security_groups()
+
+
def cleanup_odl(odl_ip, odl_port):
delete_odl_resources(odl_ip, odl_port, 'service-function-forwarder')
delete_odl_resources(odl_ip, odl_port, 'service-function-chain')
@@ -98,6 +105,7 @@ def cleanup(creators, odl_ip=None, odl_port=None):
delete_vnfds()
delete_vims()
delete_openstack_objects(creators)
+ delete_untracked_security_groups()
if odl_ip is not None and odl_port is not None:
cleanup_odl(odl_ip, odl_port)