URL: https://github.com/freeipa/freeipa/pull/1118
Author: Rezney
 Title: #1118: tests_py3: decode get_file_contents() result
Action: opened

PR body:
"""
When running tests in python3 we get bytes object instead of
bytestring and when passing it to multihost run_command we later
fail on concatenation in shell_quote().
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1118/head:pr1118
git checkout pr1118
From 9d6b0c167c0b420a70f3982e9fa2c341117b60ac Mon Sep 17 00:00:00 2001
From: Michal Reznik <mrez...@redhat.com>
Date: Fri, 29 Sep 2017 07:43:30 +0200
Subject: [PATCH] tests_py3: decode get_file_contents() result

When running tests in python3 we get bytes object instead of
bytestring and when passing it to multihost run_command we later
fail on concatenation in shell_quote().
---
 ipatests/pytest_plugins/integration/tasks.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipatests/pytest_plugins/integration/tasks.py b/ipatests/pytest_plugins/integration/tasks.py
index 9d3955d993..f054a2393c 100644
--- a/ipatests/pytest_plugins/integration/tasks.py
+++ b/ipatests/pytest_plugins/integration/tasks.py
@@ -228,7 +228,7 @@ def restore_files(host):
 def restore_hostname(host):
     backupname = os.path.join(host.config.test_dir, 'backup_hostname')
     try:
-        hostname = host.get_file_contents(backupname)
+        hostname = host.get_file_contents(backupname, encoding='utf-8')
     except IOError:
         logger.debug('No hostname backed up on %s', host.hostname)
     else:
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to