summaryrefslogtreecommitdiff
path: root/novaclient/v2/servers.py
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem.os@gmail.com>2018-06-05 19:57:49 +0000
committerMatt Riedemann <mriedem.os@gmail.com>2018-06-05 19:57:49 +0000
commitabaa86fd86d4beca0082ff1768d5306e5e86302e (patch)
treeb838d9cda69dabd72115b021978d0a7ba88e3399 /novaclient/v2/servers.py
parenteff607ccef91d09052d58f6798f68d67404f51ce (diff)
downloadpython-novaclient-abaa86fd86d4beca0082ff1768d5306e5e86302e.tar.gz
Revert "Fix listing of instances above API max_limit"
This reverts commit eff607ccef91d09052d58f6798f68d67404f51ce. There was no apparent need for the change being reverted since user can list all servers by specifying --limit=1 when running the nova list command. The change introduced a problem whereby the first pass to list instances from the server would get up to [api]/max_limit (default 1000) results and then call again with a marker. If the last instance in the list (the marker) is corrupted in the instance_mappings table in the API DB by not having an associated cell mapping, listing instances will always fail with a MarkerNotFound error even though the CLI user is not passing a marker nor specifying --limit=-1. The corrupted instance mapping record resulting in the MarkerNotFound error is something else that should be fixed on the server side (and likely result in a 500) but the change in behavior of the CLI makes it always fail if you hit this even if you're not passing a marker. Change-Id: Ibb43f500a74733b85bd3242592d36985bfb45856 Closes-Bug: #1773945
Diffstat (limited to 'novaclient/v2/servers.py')
-rw-r--r--novaclient/v2/servers.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/novaclient/v2/servers.py b/novaclient/v2/servers.py
index 805dd454..79ab0cdc 100644
--- a/novaclient/v2/servers.py
+++ b/novaclient/v2/servers.py
@@ -855,10 +855,7 @@ class ServerManager(base.BootingManagerWithFind):
result.extend(servers)
result.append_request_ids(servers.request_ids)
- if limit and limit != -1:
- limit = max(limit - len(servers), 0)
-
- if not servers or limit == 0:
+ if not servers or limit != -1:
break
marker = result[-1].id
return result