]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
qa/tasks/qemu: open file in text mode
authorKefu Chai <kchai@redhat.com>
Fri, 1 May 2020 08:52:41 +0000 (16:52 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Jun 2020 11:57:00 +0000 (19:57 +0800)
commitba7ef0ed833b1b3522e37910356a89299647a9e9
treebc9e77ca57cc3a6da52a7d704ff929dca09d4493
parentdaed5c826fb07ebb735c6d273b73a469f9e10b5e
qa/tasks/qemu: open file in text mode

in python3, if a file is opened in 'rb' mode, we will have bytes when
reading from it, as a result, we have following failure like:
```
Traceback (most recent call last):
  File "/home/teuthworker/src/git.ceph.com_git_teuthology_master/teuthology/contextutil.py", line 32, in nested
    vars.append(enter())
  File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/home/teuthworker/src/github.com_tchaikov_ceph_nautilus-py3/qa/tasks/qemu.py", line 124, in generate_iso
    test_setup = ''.join(f.readlines())
TypeError: sequence item 0: expected str instance, bytes found
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 0b21c597d438fcba43629d0795b2d4ff6112c9cf)
qa/tasks/qemu.py