Hello,
Recently I've been generating test plans on the wiki from our Declarative tests. This patch allows me to call output_for_cli directly on the `expected` output in tests.


--
PetrĀ³
From 54316205eebb1ca23c7c07e4df7be3ec913a6d39 Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pvikt...@redhat.com>
Date: Tue, 26 Nov 2013 23:31:05 +0100
Subject: [PATCH] cli.print_attribute: Convert values to strings

When output_for_cli was called directly, rather than for values
received through XML or JSON API, joining multiple values failed
on non-strings such as DN objects.

Convert output to strings before printing it out.
---
 ipalib/cli.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipalib/cli.py b/ipalib/cli.py
index 78f2949d2fcd7bbc70e31a7841bbaf9cb230af38..4cf007d31b1f4cf1c3a33527dc30cd0c8f9c1774 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -293,7 +293,7 @@ def print_attribute(self, attr, value, format='%s: %s', indent=1, one_value_per_
                     return
                 else:
                     if len(value) > 0:
-                        text = ', '.join(value)
+                        text = ', '.join(str(v) for v in value)
                     else:
                         return
                 line_len = self.get_tty_width()
-- 
1.8.4.2

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to