From 9874f7a24c6620e551d3c6e844dc63b9168b0c21 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 12 May 2020 21:13:48 +0800 Subject: [PATCH] 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 --- teuthology/orchestra/console.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teuthology/orchestra/console.py b/teuthology/orchestra/console.py index 457f0b91f3..ba327a8161 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() -- 2.39.5