summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-08-13 11:26:26 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-08-13 11:26:26 +0200
commitdac257cc209e0997dca975e0b8f69ac496f393c5 (patch)
treeaa6ad298b6239bc4c64de60122a1618f8b82e072 /pykolab
parent3cb92d3f1f6f976cc5f78e60845a43dc117b8946 (diff)
downloadpykolab-dac257cc209e0997dca975e0b8f69ac496f393c5.tar.gz
Some attributes may contain unicode, so when printing the information, convert to string (#5083)
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/cli/cmd_user_info.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pykolab/cli/cmd_user_info.py b/pykolab/cli/cmd_user_info.py
index c120353..d7b83a6 100644
--- a/pykolab/cli/cmd_user_info.py
+++ b/pykolab/cli/cmd_user_info.py
@@ -51,5 +51,10 @@ def execute(*args, **kw):
print >> sys.stderr, _("No such user %s") % (user)
sys.exit(0)
+ unic_attrs = ['displayname', 'givenname', 'cn', 'sn', 'ou', 'entrydn']
+
for (k,v) in user_info.iteritems():
- print "%s: %r" % (k,v)
+ if k in unic_attrs:
+ print "%s: %s" % (k,v)
+ else:
+ print "%s: %r" % (k,v)