]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard/qa: Fix a few linting issues in dashboard backend tests 27865/head
authorTatjana Dehler <tdehler@suse.com>
Mon, 29 Apr 2019 13:28:45 +0000 (15:28 +0200)
committerTatjana Dehler <tdehler@suse.com>
Mon, 29 Apr 2019 13:28:45 +0000 (15:28 +0200)
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
qa/tasks/mgr/dashboard/test_pool.py
qa/tasks/mgr/dashboard/test_rbd.py
qa/tasks/mgr/dashboard/test_rbd_mirroring.py
qa/tasks/mgr/dashboard/test_rgw.py
qa/tasks/mgr/dashboard/test_settings.py
qa/tasks/mgr/dashboard/test_summary.py

index 590c351607352cde1633ebcf3938406a76e3a89b..e343159d43ef57ce048fa79ad069cd086e0e412f 100644 (file)
@@ -102,7 +102,7 @@ class PoolTest(DashboardTestCase):
         prop = 'pg_num'
         pgp_prop = 'pg_placement_num'
         health = lambda: self._get('/api/health/minimal')['health']['status'] == 'HEALTH_OK'
-        t = 0;
+        t = 0
         while (int(value) != pool[pgp_prop] or not health()) and t < 180:
             time.sleep(2)
             t += 2
@@ -113,7 +113,8 @@ class PoolTest(DashboardTestCase):
     @classmethod
     def tearDownClass(cls):
         super(PoolTest, cls).tearDownClass()
-        for name in ['dashboard_pool1', 'dashboard_pool2', 'dashboard_pool3', 'dashboard_pool_update1']:
+        for name in ['dashboard_pool1', 'dashboard_pool2', 'dashboard_pool3',
+                     'dashboard_pool_update1']:
             cls._ceph_cmd(['osd', 'pool', 'delete', name, name, '--yes-i-really-really-mean-it'])
         cls._ceph_cmd(['osd', 'erasure-code-profile', 'rm', 'ecprofile'])
 
@@ -260,7 +261,6 @@ class PoolTest(DashboardTestCase):
                 update = {
                     'compression_mode': None,
                     'compression_algorithm': None,
-                    'compression_mode': None,
                     'compression_max_blob_size': None,
                     'compression_required_ratio': None,
                 }
index f9b7dd022fa65fa90ebca932a13540a2859747d7..25725f2320e51e2343eb789375dd492ab5262453 100644 (file)
@@ -144,13 +144,14 @@ class RbdTest(DashboardTestCase):
         img = cls._get('/api/block/image/{}/{}'.format(pool, name))
 
         cls._task_post("/api/block/image/{}/{}/move_trash".format(pool, name),
-                        {'delay': delay})
+                       {'delay': delay})
 
         return img['id']
 
     @classmethod
     def remove_trash(cls, pool, image_id, image_name, force=False):
-        return cls._task_delete('/api/block/image/trash/{}/{}/?image_name={}&force={}'.format('rbd', image_id, image_name, force))
+        return cls._task_delete('/api/block/image/trash/{}/{}/?image_name={}&force={}'.format(
+            'rbd', image_id, image_name, force))
 
     @classmethod
     def get_trash(cls, pool, image_id):
@@ -687,9 +688,8 @@ class RbdTest(DashboardTestCase):
 
     def test_default_features(self):
         default_features = self._get('/api/block/image/default_features')
-        self.assertEqual(default_features, ['deep-flatten', 'exclusive-lock',
-                                             'fast-diff', 'layering',
-                                             'object-map'])
+        self.assertEqual(default_features, [
+            'deep-flatten', 'exclusive-lock', 'fast-diff', 'layering', 'object-map'])
 
     def test_image_with_special_name(self):
         rbd_name = 'test/rbd'
@@ -737,7 +737,8 @@ class RbdTest(DashboardTestCase):
     def test_restore_trash(self):
         id = self.create_image_in_trash('rbd', 'test_rbd')
 
-        self._task_post('/api/block/image/trash/{}/{}/restore'.format('rbd', id), {'new_image_name': 'test_rbd'})
+        self._task_post('/api/block/image/trash/{}/{}/restore'.format('rbd', id),
+                        {'new_image_name': 'test_rbd'})
 
         self._get('/api/block/image/rbd/test_rbd')
         self.assertStatus(200)
index 5edbd890d89dc15f9aa76acf06c165ba1c8f3701..7afeaa4ad6555e3b0a2bca347279ae9ece39ecde 100644 (file)
@@ -3,9 +3,7 @@
 
 from __future__ import absolute_import
 
-import time
-
-from .helper import DashboardTestCase, JObj, JLeaf, JList
+from .helper import DashboardTestCase
 
 
 class RbdMirroringTest(DashboardTestCase):
@@ -32,7 +30,7 @@ class RbdMirroringTest(DashboardTestCase):
     def update_pool(cls, pool, mirror_mode):
         data = {'mirror_mode': mirror_mode}
         return cls._task_put('/api/block/mirroring/pool/{}'.format(pool),
-            data)
+                             data)
 
     @classmethod
     def list_peers(cls, pool):
@@ -53,12 +51,12 @@ class RbdMirroringTest(DashboardTestCase):
         data = {'cluster_name': cluster_name, 'client_id': client_id}
         data.update(kwargs)
         return cls._task_post('/api/block/mirroring/pool/{}/peer'.format(pool),
-            data)
+                              data)
 
     @classmethod
     def update_peer(cls, pool, peer_uuid, **kwargs):
         return cls._task_put('/api/block/mirroring/pool/{}/peer/{}'.format(pool, peer_uuid),
-            kwargs)
+                             kwargs)
 
     @classmethod
     def delete_peer(cls, pool, peer_uuid):
index b4c0676b0dd6cef7741c59cffdc623b984998cde..bbb9df987122f795b518715a4024e2e92357e7ea 100644 (file)
@@ -3,7 +3,6 @@ from __future__ import absolute_import
 
 import logging
 import urllib
-import six
 
 from .helper import DashboardTestCase, JObj, JList, JLeaf
 
index 5badf6ae4d69a3b641bdddd474783479e714a3fc..bc0925df223b531047818044e522b868e8be359d 100644 (file)
@@ -3,7 +3,6 @@
 from __future__ import absolute_import
 
 from .helper import DashboardTestCase, JList, JObj, JAny
-from pprint import pformat
 
 
 class SettingsTest(DashboardTestCase):
index 1a5d1e9918f949c51a5173e2b9d5d1a4be8f86ba..a31f8914673664e6f8f682ca4a74bfa6f7ddcbdb 100644 (file)
@@ -37,4 +37,3 @@ class SummaryTest(DashboardTestCase):
         self.assertIsNotNone(data['health_status'])
         self.assertIsNotNone(data['mgr_id'])
         self.assertIsNotNone(data['have_mon_connection'])
-