]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs: flake8 fixes 35674/head
authorKefu Chai <kchai@redhat.com>
Fri, 19 Jun 2020 11:26:44 +0000 (19:26 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 24 Jun 2020 02:12:11 +0000 (10:12 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
12 files changed:
qa/tasks/cephfs/filesystem.py
qa/tasks/cephfs/fuse_mount.py
qa/tasks/cephfs/kernel_mount.py
qa/tasks/cephfs/mount.py
qa/tasks/cephfs/test_admin.py
qa/tasks/cephfs/test_cephfs_shell.py
qa/tasks/cephfs/test_failover.py
qa/tasks/cephfs/test_full.py
qa/tasks/cephfs/test_meta_injection.py
qa/tasks/cephfs/test_openfiletable.py
qa/tasks/cephfs/test_snapshots.py
qa/tasks/cephfs/test_volumes.py

index 6454116b6b15d49e96a04bc607302943c74a5824..00da71cbed847fea33c80dae5366ffd54aad20d7 100644 (file)
@@ -1286,7 +1286,7 @@ class Filesystem(MDSCluster):
         """
         dirfrag_obj_name = "{0:x}.00000000".format(dir_ino)
         try:
-            ret = self.rados(["getomapval", dirfrag_obj_name, obj_name+"_head", out])
+            self.rados(["getomapval", dirfrag_obj_name, obj_name+"_head", out])
         except CommandFailedError as e:
             log.error(e.__str__())
             raise ObjectNotFound(dir_ino)
index a58c7bcd398a5514b3acc4132cbb43ee0eb03851..4de597ee1a53f2b21a9d1e4ce2ddcc02354e69e0 100644 (file)
@@ -2,7 +2,6 @@ from io import StringIO
 import json
 import time
 import logging
-import re
 import six
 
 from textwrap import dedent
@@ -100,8 +99,6 @@ class FuseMount(CephFSMount):
         run_cmd.extend(fuse_cmd)
 
         def list_connections():
-            from teuthology.misc import get_system_type
-
             conn_dir = "/sys/fs/fuse/connections"
 
             self.client_remote.run(args=['sudo', 'modprobe', 'fuse'],
index 3362885d621c9b8b3af79ee23c3eaae5ae176f63..9678099453a3ed1d9350dcb228d27b21e5bc2b4b 100644 (file)
@@ -1,11 +1,7 @@
 import json
 import logging
-import time
 from textwrap import dedent
 from teuthology.orchestra.run import CommandFailedError
-from teuthology import misc
-
-from teuthology.orchestra import remote as orchestra_remote
 from teuthology.orchestra import run
 from teuthology.contextutil import MaxWhileTries
 from tasks.cephfs.mount import CephFSMount
index 2cfa1cc3f7b0581970f1390006e9f8a79d2decbc..c953b7b82da1f21cdecdc6c714775bf6482656bd 100644 (file)
@@ -12,7 +12,6 @@ from IPy import IP
 from teuthology.orchestra import run
 from teuthology.orchestra.run import CommandFailedError, ConnectionLostError
 from tasks.cephfs.filesystem import Filesystem
-import platform
 
 log = logging.getLogger(__name__)
 
@@ -69,8 +68,6 @@ class CephFSMount(object):
 
     @netns_name.setter
     def netns_name(self, name):
-        if not isinstance(path, str):
-            raise RuntimeError('path should be of str type.')
         self._netns_name = name
 
     def is_mounted(self):
index 7ff6ed536b9ab4c95290d48319cc0e2e2c3f9c8f..393146fa28516d4f64aeca712342c0ae55cef167 100644 (file)
@@ -89,7 +89,7 @@ class TestAdminCommands(CephFSTestCase):
 
         n = "test_add_data_pool_ec"
         self._setup_ec_pools(n, metadata=False)
-        p = self.fs.add_data_pool(n+"-data", create=False)
+        self.fs.add_data_pool(n+"-data", create=False)
 
     def test_new_default_ec(self):
         """
index 3df72b9fc3987ba8a2991d4ce222901141fd2ebc..f2081c011d7e0563c8e3afc2f36f3977070a8a27 100644 (file)
@@ -4,11 +4,9 @@ export $PATH.
 """
 from io import StringIO
 from os import path
-from os import getcwd as os_getcwd
 import crypt
 import logging
 from tempfile import mkstemp as tempfile_mkstemp
-from tempfile import mkdtemp as tempfile_mkdtemp
 import math
 from six import ensure_str
 from sys import version_info as sys_version_info
@@ -16,7 +14,6 @@ from re import search as re_search
 from time import sleep
 from tasks.cephfs.cephfs_test_case import CephFSTestCase
 from teuthology.misc import sudo_write_file
-from teuthology.misc import sh as misc_sh
 from teuthology.orchestra.run import CommandFailedError
 
 log = logging.getLogger(__name__)
index ec21e61614a8ca43ef71b396f5384f8d5fca64aa..b14ff70188d2012641b3731b21e3d261e17692fd 100644 (file)
@@ -53,7 +53,7 @@ class TestClusterAffinity(CephFSTestCase):
             except AssertionError as e:
                 log.debug("%s", e)
                 return False
-        status = self.wait_until_true(takeover, 30)
+        self.wait_until_true(takeover, 30)
 
     def test_join_fs_runtime(self):
         """
@@ -126,7 +126,6 @@ class TestClusterAffinity(CephFSTestCase):
         That a standby with mds_join_fs set to another fs is still used if necessary.
         """
         status, target = self._verify_init()
-        active = self.fs.get_active_names(status=status)[0]
         standbys = [info['name'] for info in status.get_standbys()]
         for mds in standbys:
             self.config_set('mds.'+mds, 'mds_join_fs', 'cephfs2')
index eaa36c7c9d62fbc9384c357a850e7587e254cdb3..54152548677d5d6a8b5c529203f4088cb58613cc 100644 (file)
@@ -2,7 +2,6 @@ import json
 import logging
 import os
 from textwrap import dedent
-import time
 try:
     from typing import Optional
 except:
index 5a20289cad578e75b9dc07dd3200c8a812befa6a..916b30a25bc9a0aea5aab7a5fcf33bf3e0fc71c4 100644 (file)
@@ -1,6 +1,4 @@
 from tasks.cephfs.cephfs_test_case import CephFSTestCase
-import random
-import os
 
 class TestMetaInjection(CephFSTestCase):
     def test_meta_injection(self):
index d64c7d94f4d445ab206d29eda797586f4f44aa1b..34cffcee459a333925975f647d5d44d2dc5fe1bd 100644 (file)
@@ -1,8 +1,6 @@
 import time
 import logging
 from tasks.cephfs.cephfs_test_case import CephFSTestCase
-from teuthology.exceptions import CommandFailedError
-from tasks.cephfs.cephfs_test_case import CephFSTestCase, for_teuthology
 
 log = logging.getLogger(__name__)
 
@@ -44,7 +42,7 @@ class OpenFileTable(CephFSTestCase):
         mds0_openfiles.1 to hold the extra keys.
         """
 
-        stat_out = self.fs.rados(["stat", "mds0_openfiles.1"])
+        self.fs.rados(["stat", "mds0_openfiles.1"])
 
         # Now close the file
         self.mount_a.kill_background(p)
index 0a35d99d4d636bee81e39cc7bcb0f243416cd547..5a8f397d9788cb467730f5d149e6163c281c9660 100644 (file)
@@ -1,4 +1,3 @@
-import sys
 import logging
 import signal
 from textwrap import dedent
index 11c23605ae8c99ad6875214ae76f841030bac9f0..6f895f9cd525bfad2a343792e2df2ac01a806026 100644 (file)
@@ -200,13 +200,11 @@ class TestVolumes(CephFSTestCase):
         subvolpath = self._get_subvolume_path(self.volname, subvolume, group_name=subvolume_group)
 
         reg_file = "regfile.0"
-        reg_path = os.path.join(subvolpath, reg_file)
         dir_path = os.path.join(subvolpath, "dir.0")
         sym_path1 = os.path.join(subvolpath, "sym.0")
         # this symlink's ownership would be changed
         sym_path2 = os.path.join(dir_path, "sym.0")
 
-        #self.mount_a.write_n_mb(reg_path, TestVolumes.DEFAULT_FILE_SIZE)
         self.mount_a.run_shell(["sudo", "mkdir", dir_path], omit_sudo=False)
         self.mount_a.run_shell(["sudo", "ln", "-s", "./{}".format(reg_file), sym_path1], omit_sudo=False)
         self.mount_a.run_shell(["sudo", "ln", "-s", "./{}".format(reg_file), sym_path2], omit_sudo=False)