]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
qa/tasks/util/rgw: use StringIO for capturing strings
authorKefu Chai <kchai@redhat.com>
Mon, 6 Apr 2020 04:48:18 +0000 (12:48 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 7 Apr 2020 13:51:23 +0000 (21:51 +0800)
commit5d0dc8346c7c025a868fd32b112cdb32fa5dc9ea
tree0b5693a42d23af05477b983822a7ff43631e5690
parent981ad349871f6b9fb71fe6b2a9d0fd65e3720deb
qa/tasks/util/rgw: use StringIO for capturing strings

this change should address the failure of
```
2020-04-06T03:07:59.152 ERROR:teuthology.contextutil:Saw exception from nested tasks
Traceback (most recent call last):
  File "/home/teuthworker/src/git.ceph.com_git_teuthology_wip-py3/teuthology/contextutil.py", line 32, in nested
    vars.append(enter())
  File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/rgw.py", line 266, in configure_compression
    rgwadmin(ctx, client, cmd=['user', 'list'], check_status=True)
  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/util/rgw.py", line 43, in rgwadmin
    j = json.loads(out)
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/util/rgw.py