pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0031-cli.print_attribute-Convert-values-to-strings.patch

9991ea
From 32d3d38edfd47f3cc5425d3c2e7d42a38ea4a95b Mon Sep 17 00:00:00 2001
9991ea
From: Petr Viktorin <pviktori@redhat.com>
9991ea
Date: Tue, 26 Nov 2013 23:31:05 +0100
9991ea
Subject: [PATCH 31/34] cli.print_attribute: Convert values to strings
9991ea
9991ea
When output_for_cli was called directly, rather than for values
9991ea
received through XML or JSON API, joining multiple values failed
9991ea
on non-strings such as DN objects.
9991ea
9991ea
Convert output to strings before printing it out.
9991ea
---
9991ea
 ipalib/cli.py | 2 +-
9991ea
 1 file changed, 1 insertion(+), 1 deletion(-)
9991ea
9991ea
diff --git a/ipalib/cli.py b/ipalib/cli.py
9991ea
index 5f02e929fe0df7051f4bb925a960678d780d4883..41e1b4752a2a549ea687632e60eb8003d0cad95f 100644
9991ea
--- a/ipalib/cli.py
9991ea
+++ b/ipalib/cli.py
9991ea
@@ -293,7 +293,7 @@ def print_attribute(self, attr, value, format='%s: %s', indent=1, one_value_per_
9991ea
                     return
9991ea
                 else:
9991ea
                     if len(value) > 0:
9991ea
-                        text = ', '.join(value)
9991ea
+                        text = ', '.join(str(v) for v in value)
9991ea
                     else:
9991ea
                         return
9991ea
                 line_len = self.get_tty_width()
9991ea
-- 
9991ea
1.8.4.2
9991ea