summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-02-16 22:56:15 -0500
committerJason Gerard DeRose <jderose@redhat.com>2010-02-17 04:13:15 -0700
commit7ccac40175f60d22d8bed60d48b43cb894c75fd2 (patch)
tree7a5d9a6896e52d99fe49eef09b1c13d95f9f2393 /ipalib/cli.py
parentf52c671ca10c65f8b55327e12ca6a9c61c01ef37 (diff)
downloadfreeipa-7ccac40175f60d22d8bed60d48b43cb894c75fd2.tar.gz
freeipa-7ccac40175f60d22d8bed60d48b43cb894c75fd2.tar.xz
freeipa-7ccac40175f60d22d8bed60d48b43cb894c75fd2.zip
Don't base64-encode integers
This is a temporary fix until we either use Params to determine output type or treat integers differently from other binary values internally (as unicode instead of str, for example).
Diffstat (limited to 'ipalib/cli.py')
-rw-r--r--ipalib/cli.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index d8c4b8058..0cd51a88e 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -145,7 +145,11 @@ class textui(backend.Backend):
if it is a python str type, otherwise it is a plain string.
"""
if type(value) is str:
- return base64.b64encode(value)
+ try:
+ int(value)
+ return value
+ except ValueError:
+ return base64.b64encode(value)
else:
return value