From e05ce4a20d2395179580db7e3db75c601c8f364c Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Dec 14 2018 08:53:01 +0000 Subject: Python 2 compatibility Make new test helpers and test code compatible with Python 2.7. See: https://pagure.io/freeipa/issue/7751 Signed-off-by: Christian Heimes Reviewed-By: Alexander Bokovoy Reviewed-By: Rob Crittenden --- diff --git a/ipatests/pytest_ipa/integration/host.py b/ipatests/pytest_ipa/integration/host.py index 6aed58a..eb05872 100644 --- a/ipatests/pytest_ipa/integration/host.py +++ b/ipatests/pytest_ipa/integration/host.py @@ -65,7 +65,7 @@ class Host(pytest_multihost.host.Host): log_stdout=True, raiseonerr=True, cwd=None, bg=False, encoding='utf-8'): # Wrap run_command to log stderr on raiseonerr=True - result = super().run_command( + result = super(Host, self).run_command( argv, set_env=set_env, stdin_text=stdin_text, log_stdout=log_stdout, raiseonerr=False, cwd=cwd, bg=bg, encoding=encoding @@ -74,7 +74,7 @@ class Host(pytest_multihost.host.Host): result.log.error('stderr: %s', result.stderr_text) raise subprocess.CalledProcessError( result.returncode, argv, - result.stdout_text, result.stderr_text + result.stderr_text ) else: return result diff --git a/ipatests/test_integration/test_advise.py b/ipatests/test_integration/test_advise.py index b548614..761f278 100644 --- a/ipatests/test_integration/test_advise.py +++ b/ipatests/test_integration/test_advise.py @@ -20,6 +20,8 @@ # FIXME: Pylint errors # pylint: disable=no-member +from __future__ import absolute_import + import re from ipalib.constants import IPAAPI_USER