summaryrefslogtreecommitdiff
path: root/ceilometerclient/common
diff options
context:
space:
mode:
authorxialinjuan <ljxiash@cn.ibm.com>2016-01-13 17:31:10 +0800
committerxialinjuan <ljxiash@cn.ibm.com>2016-01-14 18:00:33 +0800
commitd6560fb4986f43a2f2e64e14bb4effc969cc4ecd (patch)
tree58e8feedd09adee7206d9d35895b7c46788707c7 /ceilometerclient/common
parent25517d0226e69bbabf9679c80445746a5cab846d (diff)
downloadpython-ceilometerclient-d6560fb4986f43a2f2e64e14bb4effc969cc4ecd.tar.gz
change the dict output format to make consistency under py27 and py34
For the command output in ceilometer cli, if it is a dict and it has items which is list type, originally it won't handle the items in the list. As to under py27, the string type in the list is unicode, the string always look like u"http://alarm", while under py34 the string is "http://alarm", this cause output inconsistency. This patch will handle this inconsistency. Change-Id: I5e7cf4052f68e5a434bcf86242b11365b34750a0
Diffstat (limited to 'ceilometerclient/common')
-rw-r--r--ceilometerclient/common/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ceilometerclient/common/utils.py b/ceilometerclient/common/utils.py
index d1ac720..84dcac8 100644
--- a/ceilometerclient/common/utils.py
+++ b/ceilometerclient/common/utils.py
@@ -89,7 +89,7 @@ def print_dict(d, dict_property="Property", wrap=0):
pt.align = 'l'
for k, v in sorted(six.iteritems(d)):
# convert dict to str to check length
- if isinstance(v, dict):
+ if isinstance(v, (list, dict)):
v = jsonutils.dumps(v)
# if value has a newline, add in multiple rows
# e.g. fault with stacktrace