From 0791b107db305d3b1223eb800807c936fb59b5b3 Mon Sep 17 00:00:00 2001 From: Armando Neto Date: Jul 18 2018 10:00:57 +0000 Subject: 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 Reviewed-By: Christian Heimes --- diff --git a/ipaclient/remote_plugins/schema.py b/ipaclient/remote_plugins/schema.py index d9a5fb0..7b76f0c 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 a98f5a9..f44130d 100644 --- a/ipatests/test_integration/test_commands.py +++ b/ipatests/test_integration/test_commands.py @@ -152,3 +152,10 @@ class TestIPACommand(IntegrationTest): ["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