From 2814b78be290099e684fbed7ccc61e9ef03c5dca Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Tue, 16 Feb 2010 22:56:15 -0500
Subject: [PATCH] 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 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/ipalib/cli.py b/ipalib/cli.py
index d8c4b80..0cd51a8 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
 
-- 
1.6.2.5

