when testing changes to trustdomain-find to display status of the child
domain (Domain enabled: True/False), Steeve found that on RHEL 7 beta
Python doesn't coerce bool to string, while on Fedora 20 it does.

To work around this issue I decided to extend encode_binary() method by
converting bool values to unicode in CLI output.

Steeve will file a ticket shortly.

/ Alexander Bokovoy
>From 1b3d0f2313a66f546307bec42a3fb9624bd35a45 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <aboko...@redhat.com>
Date: Thu, 16 Jan 2014 19:19:11 +0200
Subject: [PATCH 3/3] CLI output: support bool values within records

CLI output formatting code did not expect list of entries where some
attributes of the record have bool type. CLI output was only accepting
bool values at the topmost level.
 ipalib/cli.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ipalib/cli.py b/ipalib/cli.py
index 4cf007d..4b56d0b 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -158,6 +158,8 @@ class textui(backend.Backend):
         if type(value) is str:
             return base64.b64encode(value)
+        elif type(value) is bool:
+            return unicode(value)
             return value

Freeipa-devel mailing list

Reply via email to