]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks: flake8 fixes
authorKefu Chai <kchai@redhat.com>
Fri, 19 Jun 2020 11:26:10 +0000 (19:26 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 23 Jun 2020 15:00:56 +0000 (23:00 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/ceph.py
qa/tasks/ceph_deploy.py
qa/tasks/ceph_manager.py
qa/tasks/ceph_objectstore_tool.py
qa/tasks/cephadm.py
qa/tasks/scrub.py
qa/tasks/systemd.py

index 4bb5c94a625e2aa871ab37c10e69f1615a0e99a0..b83995acb40adf3b91f47893c8d2dd40387042c2 100644 (file)
@@ -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(
index 149607ca4ec4732693fd403c08e47540b35d4a14..95687aba9e91313fcb170df74fea028d4f3caea1 100644 (file)
@@ -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
index 2516043217b7d63cdb0085c239e10257f652c571..f25d8a08df9899dc97b708f131b37c6af547a4ae 100644 (file)
@@ -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]
index d4facfd782f0a78bf23b2f89a612c7103239b74f..e19a0bd218e2920ab64f9d2e12c532b691968a33 100644 (file)
@@ -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")
index 51fba7f8e1bc5e17ebbd290fab622a1e57a15745..cb873aaccc4bdc0d28fcea0dedc1ecc35a6a2985 100644 (file)
@@ -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 = {}
index 7cf304e845d0785b7254339247536b33b5cfd93b..ddc1a9164cfc825cd5ba9e35cc4c1eb088baadac 100644 (file)
@@ -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__)
index 745f503c903fe3e8e61d923d53f5fe2baf416d4b..1728b920f380ac7177c921db29bce1c8602daf8d 100644 (file)
@@ -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',