From: Kefu Chai Date: Mon, 6 Apr 2020 13:14:36 +0000 (+0800) Subject: qa/tasks/ragweed.py: open file in text mode X-Git-Tag: v14.2.10~17^2~56 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=78746b3fc5aaf4f7bf3a4aae822d8143edab1d95;p=ceph.git qa/tasks/ragweed.py: open file in text mode this file is a template for `boto.cfg` which only contains text, so we can just open it in text mode, and the file-like object will be passed to run() as stdin, which is able to consume strings. Signed-off-by: Kefu Chai (cherry picked from commit 3809737fb859ebebe72d635708e0d69676cc5aa6) --- diff --git a/qa/tasks/ragweed.py b/qa/tasks/ragweed.py index 5fff317396b5..1368d0cb6f20 100644 --- a/qa/tasks/ragweed.py +++ b/qa/tasks/ragweed.py @@ -225,7 +225,7 @@ def configure(ctx, config, run_stages): log.info('Configuring boto...') boto_src = os.path.join(os.path.dirname(__file__), 'boto.cfg.template') for client, properties in config['clients'].items(): - with open(boto_src, 'rb') as f: + with open(boto_src, 'r') as f: (remote,) = ctx.cluster.only(client).remotes.keys() conf = f.read().format( idle_timeout=config.get('idle_timeout', 30)