Merge "Fix list resources when use limit and with-count"
This commit is contained in:
commit
0a685a7937
@ -123,6 +123,12 @@ class Manager(common_base.HookableMixin):
|
||||
# till there is no more items.
|
||||
items = self._list(next, response_key, obj_class, None,
|
||||
limit, items)
|
||||
# If we use '--with-count' to get the resource count,
|
||||
# the _list function will return the tuple result with
|
||||
# (resources, count).
|
||||
# So here, we must check the items' type then to do return.
|
||||
if isinstance(items, tuple):
|
||||
items = items[0]
|
||||
if "count" in body:
|
||||
return common_base.ListWithMeta(items, resp), body['count']
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user