Fix the count error in zaqarclient
now count number didn't show in the result. Fix this bug. Change-Id: I87788bf4b992e36119e8432d76ccaf66328cce42
This commit is contained in:
@@ -88,9 +88,10 @@ class ListQueues(command.Lister):
|
||||
columns.extend(["Metadata_Dict", "Href"])
|
||||
if parsed_args.with_count is not None and parsed_args.with_count:
|
||||
kwargs["with_count"] = parsed_args.with_count
|
||||
columns.extend(["Count"])
|
||||
|
||||
data = client.queues(**kwargs)
|
||||
data, count = client.queues(**kwargs)
|
||||
if count:
|
||||
print("Queues in total: %s" % count)
|
||||
columns = tuple(columns)
|
||||
return (columns, (utils.get_item_properties(s, columns) for s in data))
|
||||
|
||||
|
@@ -56,6 +56,24 @@ class Client(client.Client):
|
||||
"""
|
||||
return queues.Queue(self, ref, **kwargs)
|
||||
|
||||
def queues(self, **params):
|
||||
"""Gets a list of queues from the server
|
||||
|
||||
:returns: A list of queues
|
||||
:rtype: `list`
|
||||
"""
|
||||
req, trans = self._request_and_transport()
|
||||
|
||||
queue_list = core.queue_list(trans, req, **params)
|
||||
|
||||
count = None
|
||||
if params.get("with_count"):
|
||||
count = queue_list.get("count", None)
|
||||
|
||||
return iterator._Iterator(self, queue_list, 'queues',
|
||||
self.queues_module.create_object(self)),\
|
||||
count
|
||||
|
||||
@decorators.version(min_version=2)
|
||||
def subscription(self, queue_name, **kwargs):
|
||||
"""Returns a subscription instance
|
||||
|
Reference in New Issue
Block a user