]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology/orchestra: open log file in Python3 way 1471/head
authorKefu Chai <kchai@redhat.com>
Tue, 12 May 2020 13:13:48 +0000 (21:13 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 12 May 2020 13:14:31 +0000 (21:14 +0800)
otherwise we could have
```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'file' is not defined
```

Fixes: https://tracker.ceph.com/issues/45512
Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/orchestra/console.py

index 457f0b91f3634d07c459481e9be948c8b703c671..ba327a816112a49699212a87e7a7311cc09f9bad 100644 (file)
@@ -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()