diff --git a/ceilometerclient/common/utils.py b/ceilometerclient/common/utils.py index 82f5b08d..2d3176ba 100644 --- a/ceilometerclient/common/utils.py +++ b/ceilometerclient/common/utils.py @@ -26,6 +26,7 @@ import prettytable from ceilometerclient import exc from ceilometerclient.openstack.common import cliutils from ceilometerclient.openstack.common import importutils +from ceilometerclient.openstack.common import strutils # Decorator for cli-args @@ -74,6 +75,8 @@ def print_dict(d, dict_property="Property", wrap=0): # convert dict to str to check length if isinstance(v, dict): v = str(v) + if isinstance(v, six.string_types): + v = strutils.safe_encode(v) # if value has a newline, add in multiple rows # e.g. fault with stacktrace if v and isinstance(v, six.string_types) and r'\n' in v: