From: Kefu Chai Date: Fri, 19 Jun 2020 11:26:10 +0000 (+0800) Subject: qa/tasks: flake8 fixes X-Git-Tag: v16.1.0~1962^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2fa726b88c9f655006a1cc009c522ad003b07016;p=ceph.git qa/tasks: flake8 fixes Signed-off-by: Kefu Chai --- diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 4bb5c94a625e..b83995acb40a 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -26,7 +26,7 @@ from teuthology import misc as teuthology from teuthology import contextutil from teuthology import exceptions from teuthology.orchestra import run -import tasks.ceph_client as cclient +from tasks import ceph_client as cclient from teuthology.orchestra.daemon import DaemonGroup from tasks.daemonwatchdog import DaemonWatchdog @@ -1477,7 +1477,6 @@ def suppress_mon_health_to_clog(ctx, config): restore the tweaked option at the /end/ of 'tasks' block. """ if config.get('mon-health-to-clog', 'true') == 'false': - saved_options = {} cluster = config.get('cluster', 'ceph') manager = ctx.managers[cluster] manager.raw_cluster_command( diff --git a/qa/tasks/ceph_deploy.py b/qa/tasks/ceph_deploy.py index 149607ca4ec4..95687aba9e91 100644 --- a/qa/tasks/ceph_deploy.py +++ b/qa/tasks/ceph_deploy.py @@ -701,7 +701,7 @@ def cli_test(ctx, config): time.sleep(4) for i in range(3): umount_dev = "{d}1".format(d=devs[i]) - r = remote.run(args=['sudo', 'umount', run.Raw(umount_dev)]) + remote.run(args=['sudo', 'umount', run.Raw(umount_dev)]) cmd = 'purge ' + nodename execute_cdeploy(admin, cmd, path) cmd = 'purgedata ' + nodename diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 2516043217b7..f25d8a08df98 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -26,7 +26,6 @@ from teuthology.orchestra.remote import Remote from teuthology.orchestra import run from teuthology.exceptions import CommandFailedError from tasks.thrasher import Thrasher -from six import StringIO try: from subprocess import DEVNULL # py3k @@ -39,7 +38,6 @@ log = logging.getLogger(__name__) # this is for cephadm clusters def shell(ctx, cluster_name, remote, args, name=None, **kwargs): - testdir = teuthology.get_testdir(ctx) extra_args = [] if name: extra_args = ['-n', name] diff --git a/qa/tasks/ceph_objectstore_tool.py b/qa/tasks/ceph_objectstore_tool.py index d4facfd782f0..e19a0bd218e2 100644 --- a/qa/tasks/ceph_objectstore_tool.py +++ b/qa/tasks/ceph_objectstore_tool.py @@ -511,12 +511,12 @@ def test_objectstore(ctx, config, cli_remote, REP_POOL, REP_NAME, ec=False): try: info = remote.sh(cmd, wait=True) except CommandFailedError as e: - log.error("Failure of --op info command with {ret}". - format(e.exitstatus)) + log.error("Failure of --op info command with %s", + e.exitstatus) ERRORS += 1 continue if not str(pg) in info: - log.error("Bad data from info: {info}".format(info=info)) + log.error("Bad data from info: %s", info) ERRORS += 1 log.info("Test pg logging") diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 51fba7f8e1bc..cb873aaccc4b 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -31,7 +31,7 @@ log = logging.getLogger(__name__) def _shell(ctx, cluster_name, remote, args, extra_cephadm_args=[], **kwargs): - testdir = teuthology.get_testdir(ctx) + teuthology.get_testdir(ctx) return remote.run( args=[ 'sudo', @@ -769,12 +769,9 @@ def ceph_rgw(ctx, config): @contextlib.contextmanager def ceph_clients(ctx, config): cluster_name = config['cluster'] - testdir = teuthology.get_testdir(ctx) log.info('Setting up client nodes...') clients = ctx.cluster.only(teuthology.is_type('client', cluster_name)) - testdir = teuthology.get_testdir(ctx) - coverage_dir = '{tdir}/archive/coverage'.format(tdir=testdir) for remote, roles_for_host in clients.remotes.items(): for role in teuthology.cluster_roles_of_type(roles_for_host, 'client', cluster_name): @@ -1122,8 +1119,6 @@ def task(ctx, config): teuthology.deep_merge(config, overrides.get('cephadm', {})) log.info('Config: ' + str(config)) - testdir = teuthology.get_testdir(ctx) - # set up cluster context if not hasattr(ctx, 'ceph'): ctx.ceph = {} diff --git a/qa/tasks/scrub.py b/qa/tasks/scrub.py index 7cf304e845d0..ddc1a9164cfc 100644 --- a/qa/tasks/scrub.py +++ b/qa/tasks/scrub.py @@ -7,7 +7,7 @@ import logging import random import time -import tasks.ceph_manager +from tasks import ceph_manager from teuthology import misc as teuthology log = logging.getLogger(__name__) diff --git a/qa/tasks/systemd.py b/qa/tasks/systemd.py index 745f503c903f..1728b920f380 100644 --- a/qa/tasks/systemd.py +++ b/qa/tasks/systemd.py @@ -69,7 +69,7 @@ def task(ctx, config): mon_role_name = 'mon.' + name mds_role_name = 'mds.' + name mgr_role_name = 'mgr.' + name - m_osd = re.search('--id (\d+) --setuser ceph', r.stdout.getvalue()) + m_osd = re.search('--id (\d+) --setuser ceph', ps_eaf) if m_osd: osd_service = 'ceph-osd@{m}.service'.format(m=m_osd.group(1)) remote.run(args=['sudo', 'systemctl', 'status',