Blob Blame History Raw
From 32d3d38edfd47f3cc5425d3c2e7d42a38ea4a95b Mon Sep 17 00:00:00 2001
From: Petr Viktorin <pviktori@redhat.com>
Date: Tue, 26 Nov 2013 23:31:05 +0100
Subject: [PATCH 31/34] 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 5f02e929fe0df7051f4bb925a960678d780d4883..41e1b4752a2a549ea687632e60eb8003d0cad95f 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