URL: https://github.com/freeipa/freeipa/pull/2166
Author: tiran
 Title: #2166: [Backport][ipa-4-6] Fix regression: Handle unicode where str is 
expected
Action: opened

PR body:
"""
This PR was opened automatically because PR #2165 was pushed to master and 
backport to ipa-4-6 is required.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2166/head:pr2166
git checkout pr2166
From a5d849d79469e63effc9d01accded180b88394be Mon Sep 17 00:00:00 2001
From: Armando Neto <abiag...@redhat.com>
Date: Tue, 17 Jul 2018 16:08:49 -0300
Subject: [PATCH] Fix regression: Handle unicode where str is expected

Regression caused by 947ac4bc1f6f4016cf5baf2ecb4577e893bc3948 when
trying to fix a similar issue for clients running Python 3. However,
that fix broke Python 2 clients.

Issue: https://pagure.io/freeipa/issue/7626

Signed-off-by: Armando Neto <abiag...@redhat.com>
---
 ipaclient/remote_plugins/schema.py         | 2 +-
 ipatests/test_integration/test_commands.py | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ipaclient/remote_plugins/schema.py b/ipaclient/remote_plugins/schema.py
index d9a5fb0361..7b76f0ca6d 100644
--- a/ipaclient/remote_plugins/schema.py
+++ b/ipaclient/remote_plugins/schema.py
@@ -608,7 +608,7 @@ def get_package(server_info, client):
             s = topic['topic_topic']
             if isinstance(s, bytes):
                 s = s.decode('utf-8')
-            module.topic = s.partition('/')[0]
+            module.topic = str(s).partition('/')[0]
         else:
             module.topic = None
 
diff --git a/ipatests/test_integration/test_commands.py b/ipatests/test_integration/test_commands.py
index a98f5a993b..f44130d1d3 100644
--- a/ipatests/test_integration/test_commands.py
+++ b/ipatests/test_integration/test_commands.py
@@ -152,3 +152,10 @@ def test_ipa_console(self):
             ["ipa", "console", filename],
         )
         assert "ipalib.config.Env" in result.stdout_text
+
+    def test_list_help_topics(self):
+        result = self.master.run_command(
+            ["ipa", "help", "topics"],
+            raiseonerr=False
+        )
+        assert result.returncode == 0
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/freeipa-devel@lists.fedorahosted.org/message/OMA5L5RTUMYQ445INI6AJNDM3A6CUI7X/

Reply via email to