Fix ipa hbactest output

ipa hbactest command produces a Traceback (TypeError: cannot concatenate
'str' and 'bool' objects)
This happens because hbactest overrides output_for_cli but does not
properly handle the output for 'value' field. 'value' contains a boolean
but it should not be displayed (refer to ipalib/frontend.py,
Command.output_for_cli()).

Note that the issue did not appear before because the 'value' field
had a flag no_display.

https://fedorahosted.org/freeipa/ticket/6157

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Florence Blanc-Renaud 2016-08-02 10:40:54 +02:00 committed by Martin Basti
parent 2df047b8c5
commit cad6a551d6

View File

@ -39,13 +39,15 @@ class hbactest(CommandOverride):
# to be printed as our execute() method will return None for corresponding
# entries and None entries will be skipped.
for o in self.output:
if o == 'value':
continue
outp = self.output[o]
if 'no_display' in outp.flags:
continue
result = output[o]
if isinstance(result, (list, tuple)):
textui.print_attribute(unicode(outp.doc), result, '%s: %s', 1, True)
elif isinstance(result, (unicode, bool)):
elif isinstance(result, unicode):
if o == 'summary':
textui.print_summary(result)
else: