diff options
author | Kefu Chai <kchai@redhat.com> | 2019-12-24 03:47:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-24 03:47:07 +0100 |
commit | 4c6a5798c2e68095ed629e265196c4d3c264ae52 (patch) | |
tree | 767348546afe7dc6219b427c3c8c9449f661ff43 /qa/tasks/s3tests.py | |
parent | Merge pull request #32312 from badone/wip-nature-theme-changes (diff) | |
parent | qa: Fix flake8 for qa/tasks/cephfs/test_volumes.py (diff) | |
download | ceph-4c6a5798c2e68095ed629e265196c4d3c264ae52.tar.xz ceph-4c6a5798c2e68095ed629e265196c4d3c264ae52.zip |
Merge pull request #32222 from toabctl/qa-flake8-py3
qa: Run flake8 on python2 and python3
Reviewed-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'qa/tasks/s3tests.py')
-rw-r--r-- | qa/tasks/s3tests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/qa/tasks/s3tests.py b/qa/tasks/s3tests.py index 767f910364a..5adb6fd5bcb 100644 --- a/qa/tasks/s3tests.py +++ b/qa/tasks/s3tests.py @@ -78,9 +78,9 @@ def _config_user(s3tests_conf, section, user): s3tests_conf[section].setdefault('user_id', user) s3tests_conf[section].setdefault('email', '{user}+test@test.test'.format(user=user)) s3tests_conf[section].setdefault('display_name', 'Mr. {user}'.format(user=user)) - s3tests_conf[section].setdefault('access_key', ''.join(random.choice(string.uppercase) for i in xrange(20))) + s3tests_conf[section].setdefault('access_key', ''.join(random.choice(string.uppercase) for i in range(20))) s3tests_conf[section].setdefault('secret_key', base64.b64encode(os.urandom(40))) - s3tests_conf[section].setdefault('totp_serial', ''.join(random.choice(string.digits) for i in xrange(10))) + s3tests_conf[section].setdefault('totp_serial', ''.join(random.choice(string.digits) for i in range(10))) s3tests_conf[section].setdefault('totp_seed', base64.b32encode(os.urandom(40))) s3tests_conf[section].setdefault('totp_seconds', '5') @@ -218,7 +218,7 @@ def configure(ctx, config): slow_backend = properties.get('slow_backend') if slow_backend: - s3tests_conf['fixtures']['slow backend'] = slow_backend + s3tests_conf['fixtures']['slow backend'] = slow_backend (remote,) = ctx.cluster.only(client).remotes.keys() remote.run( @@ -240,7 +240,7 @@ def configure(ctx, config): log.info('Configuring boto...') boto_src = os.path.join(os.path.dirname(__file__), 'boto.cfg.template') for client, properties in config['clients'].items(): - with file(boto_src, 'rb') as f: + with open(boto_src, 'rb') as f: (remote,) = ctx.cluster.only(client).remotes.keys() conf = f.read().format( idle_timeout=config.get('idle_timeout', 30) |