From 7102def745beb11148e754e58126c4eb25201e12 Mon Sep 17 00:00:00 2001 From: Adit Sarfaty Date: Thu, 15 Jun 2017 12:06:07 +0300 Subject: [PATCH] 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 --- devstack/tools/nsxv3_cleanup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devstack/tools/nsxv3_cleanup.py b/devstack/tools/nsxv3_cleanup.py index eb45ecf4c2..de43ee90af 100755 --- a/devstack/tools/nsxv3_cleanup.py +++ b/devstack/tools/nsxv3_cleanup.py @@ -160,7 +160,7 @@ class NSXClient(object): while missing > 0 and not cursor.startswith(self.NULL_CURSOR_PREFIX): response = requests.get(url + cursor, headers=self.headers, verify=self.verify, params=params).json() - cursor = response['cursor'] + cursor = response.get('cursor', self.NULL_CURSOR_PREFIX) missing -= len(response['results']) results += response['results']