Fix regression: Handle unicode where str is expected
Regression caused by 947ac4bc1f 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 <abiagion@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
1 parent
4b2af2570a
commit
717d59e2fe
2 files changed
+8
-1
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -180,3 +180,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
|
||||
Reference in new issue
Block a user