From 6437166e1ea194f7466ad714245dd1e4a0403707 Mon Sep 17 00:00:00 2001 From: Seif Lotfy Date: Thu, 26 Sep 2013 21:48:17 +0000 Subject: Add quota-usage command Added a new command quota-usage to allow querying the usage of the quota for a given tenant Change-Id: I720e6df94f9fedbb8b6385bd1707600542aaea08 --- cinderclient/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cinderclient/utils.py') diff --git a/cinderclient/utils.py b/cinderclient/utils.py index 0fdcce9..7a728d7 100644 --- a/cinderclient/utils.py +++ b/cinderclient/utils.py @@ -168,7 +168,10 @@ def print_list(objs, fields, formatters={}, order_by=None): field_name = field.replace(' ', '_') else: field_name = field.lower().replace(' ', '_') - data = getattr(o, field_name, '') + if type(o) == dict and field in o: + data = o[field] + else: + data = getattr(o, field_name, '') row.append(data) pt.add_row(row) -- cgit v1.2.1