summaryrefslogtreecommitdiff
path: root/cinderclient/utils.py
diff options
context:
space:
mode:
authorSeif Lotfy <s.lotfy@telekom.de>2013-09-26 21:48:17 +0000
committerSeif Lotfy <s.lotfy@telekom.de>2013-10-03 17:43:20 +0000
commit6437166e1ea194f7466ad714245dd1e4a0403707 (patch)
treea7ac7c367cb3bee13c7398a65c6c0392ee998792 /cinderclient/utils.py
parent10a3c0fc8422efabeb0a0f718071021aae08176d (diff)
downloadpython-cinderclient-6437166e1ea194f7466ad714245dd1e4a0403707.tar.gz
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
Diffstat (limited to 'cinderclient/utils.py')
-rw-r--r--cinderclient/utils.py5
1 files changed, 4 insertions, 1 deletions
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)