From 701af81a929532bc1cd1a0fa2599e33d1f576da4 Mon Sep 17 00:00:00 2001 From: vmware Date: Wed, 5 Oct 2016 16:38:50 +0530 Subject: [PATCH] devstack: fixed backend cleanup during unstack unstack should only delete ns-group created by openstack Change-Id: I0b35fb52909fa18d5f3b9d14fa5f368ef5990880 Closes-bug: #1740678 --- devstack/tools/nsxv3_cleanup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devstack/tools/nsxv3_cleanup.py b/devstack/tools/nsxv3_cleanup.py index 8e3f302668..a387d72f0f 100755 --- a/devstack/tools/nsxv3_cleanup.py +++ b/devstack/tools/nsxv3_cleanup.py @@ -184,7 +184,7 @@ class NSXClient(object): """ os_resources = [r for r in resources if 'tags' in r for tag in r['tags'] - if 'os-project-id' in tag.values()] + if 'os-api-version' in tag.values()] return os_resources def get_logical_switches(self): @@ -286,7 +286,8 @@ class NSXClient(object): Retrieve all NSGroups on NSX backend """ response = self.get(endpoint="/ns-groups") - return response.json()['results'] + ns_groups = response.json()['results'] + return self.get_os_resources(ns_groups) def cleanup_os_ns_groups(self): """