From 7ccac40175f60d22d8bed60d48b43cb894c75fd2 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 16 Feb 2010 22:56:15 -0500 Subject: 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). --- ipalib/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipalib/cli.py') 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 -- cgit