From: Kefu Chai Date: Tue, 12 May 2020 13:13:48 +0000 (+0800) Subject: teuthology/orchestra: open log file in Python3 way X-Git-Tag: 1.1.0~116^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1471%2Fhead;p=teuthology.git teuthology/orchestra: open log file in Python3 way otherwise we could have ``` Traceback (most recent call last): File "", line 1, in NameError: name 'file' is not defined ``` Fixes: https://tracker.ceph.com/issues/45512 Signed-off-by: Kefu Chai --- diff --git a/teuthology/orchestra/console.py b/teuthology/orchestra/console.py index 457f0b91..ba327a81 100644 --- a/teuthology/orchestra/console.py +++ b/teuthology/orchestra/console.py @@ -285,7 +285,7 @@ class PhysicalConsole(RemoteConsole): """ pexpect_templ = \ "import pexpect; " \ - "pexpect.run('{cmd}', logfile=file('{log}', 'w'), timeout=None)" + "pexpect.run('{cmd}', logfile=open('{log}', 'wb'), timeout=None)" def start(): console_cmd = self._console_command()