summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdit Sarfaty <asarfaty@vmware.com>2017-06-15 12:06:07 +0300
committergaryk <gkotton@vmware.com>2017-06-17 05:17:52 +0000
commit7102def745beb11148e754e58126c4eb25201e12 (patch)
treeab356e7f6457f1ab8efa9749451d8ebb3706dd94
parent5e5b75c5ea76a6a0611e91191ad88e1528442d37 (diff)
NSX-V3| fix devstack cleanup
Backend list results do not always have the cursor field so we should use get when accessing it. Change-Id: I3f31b56c50a8f014cc322ceb5e6c69b5540c879e
Notes
Notes (review): Code-Review+2: Tong Liu <tongl@vmware.com> Code-Review+2: garyk <gkotton@vmware.com> Workflow+1: garyk <gkotton@vmware.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Sat, 17 Jun 2017 06:19:37 +0000 Reviewed-on: https://review.openstack.org/474503 Project: openstack/vmware-nsx Branch: refs/heads/master
-rwxr-xr-xdevstack/tools/nsxv3_cleanup.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/devstack/tools/nsxv3_cleanup.py b/devstack/tools/nsxv3_cleanup.py
index eb45ecf..de43ee9 100755
--- a/devstack/tools/nsxv3_cleanup.py
+++ b/devstack/tools/nsxv3_cleanup.py
@@ -160,7 +160,7 @@ class NSXClient(object):
160 while missing > 0 and not cursor.startswith(self.NULL_CURSOR_PREFIX): 160 while missing > 0 and not cursor.startswith(self.NULL_CURSOR_PREFIX):
161 response = requests.get(url + cursor, headers=self.headers, 161 response = requests.get(url + cursor, headers=self.headers,
162 verify=self.verify, params=params).json() 162 verify=self.verify, params=params).json()
163 cursor = response['cursor'] 163 cursor = response.get('cursor', self.NULL_CURSOR_PREFIX)
164 missing -= len(response['results']) 164 missing -= len(response['results'])
165 results += response['results'] 165 results += response['results']
166 166