403b09
From 56f6fe1df44bc9d3f434b0bccd44bc11cda89999 Mon Sep 17 00:00:00 2001
403b09
From: Florence Blanc-Renaud <flo@redhat.com>
403b09
Date: Tue, 2 Aug 2016 10:40:54 +0200
403b09
Subject: [PATCH] Fix ipa hbactest output
403b09
403b09
ipa hbactest command produces a Traceback (TypeError: cannot concatenate
403b09
'str' and 'bool' objects)
403b09
This happens because hbactest overrides output_for_cli but does not
403b09
properly handle the output for 'value' field. 'value' contains a boolean
403b09
but it should not be displayed (refer to ipalib/frontend.py,
403b09
Command.output_for_cli()).
403b09
403b09
Note that the issue did not appear before because the 'value' field
403b09
had a flag no_display.
403b09
403b09
https://fedorahosted.org/freeipa/ticket/6157
403b09
403b09
Reviewed-By: Martin Basti <mbasti@redhat.com>
403b09
---
403b09
 ipaclient/plugins/hbactest.py | 4 +++-
403b09
 1 file changed, 3 insertions(+), 1 deletion(-)
403b09
403b09
diff --git a/ipaclient/plugins/hbactest.py b/ipaclient/plugins/hbactest.py
403b09
index 2518719522c4eddff2e6bc341ee9a7c34b431938..1b54530b236cf654bc8ece7ab4e329850f5a6815 100644
403b09
--- a/ipaclient/plugins/hbactest.py
403b09
+++ b/ipaclient/plugins/hbactest.py
403b09
@@ -39,13 +39,15 @@ class hbactest(CommandOverride):
403b09
         # to be printed as our execute() method will return None for corresponding
403b09
         # entries and None entries will be skipped.
403b09
         for o in self.output:
403b09
+            if o == 'value':
403b09
+                continue
403b09
             outp = self.output[o]
403b09
             if 'no_display' in outp.flags:
403b09
                 continue
403b09
             result = output[o]
403b09
             if isinstance(result, (list, tuple)):
403b09
                 textui.print_attribute(unicode(outp.doc), result, '%s: %s', 1, True)
403b09
-            elif isinstance(result, (unicode, bool)):
403b09
+            elif isinstance(result, unicode):
403b09
                 if o == 'summary':
403b09
                     textui.print_summary(result)
403b09
                 else:
403b09
-- 
403b09
2.7.4
403b09