]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/mgr: partial revert of 'import with full path'
authorKefu Chai <kchai@redhat.com>
Thu, 26 Mar 2020 06:33:06 +0000 (14:33 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 2 Jun 2020 02:32:22 +0000 (10:32 +0800)
this change partially reverts #34139

using relative import helps with readability and ease the pain to write
down the full parent module name

in #34139, all relative imports were replaced with full path, because we
were using following code to verify if the code is python3 compatible:

```
  mod_spec = importlib.util.spec_from_file_location(mod_name, path)
  mod = importlib.util.module_from_spec(mod_spec)
  mod_spec.loader.exec_module(mod)
```

but this does not work with submodule which can import using relative
import without specifying the name of the package and its parent module.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit b0bdbc34147c7e795e1a01cce1197b990c48effb)

Conflicts:
qa/tasks/mgr/dashboard/test_auth.py
qa/tasks/mgr/dashboard/test_cephfs.py
qa/tasks/mgr/dashboard/test_crush_rule.py
qa/tasks/mgr/dashboard/test_host.py
qa/tasks/mgr/dashboard/test_orchestrator.py
qa/tasks/mgr/dashboard/test_user.py: trivial resolutions

21 files changed:
qa/tasks/mgr/dashboard/test_auth.py
qa/tasks/mgr/dashboard/test_cephfs.py
qa/tasks/mgr/dashboard/test_cluster_configuration.py
qa/tasks/mgr/dashboard/test_erasure_code_profile.py
qa/tasks/mgr/dashboard/test_ganesha.py
qa/tasks/mgr/dashboard/test_health.py
qa/tasks/mgr/dashboard/test_host.py
qa/tasks/mgr/dashboard/test_logs.py
qa/tasks/mgr/dashboard/test_mgr_module.py
qa/tasks/mgr/dashboard/test_monitor.py
qa/tasks/mgr/dashboard/test_osd.py
qa/tasks/mgr/dashboard/test_perf_counters.py
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_requests.py
qa/tasks/mgr/dashboard/test_rgw.py
qa/tasks/mgr/dashboard/test_role.py
qa/tasks/mgr/dashboard/test_settings.py
qa/tasks/mgr/dashboard/test_summary.py
qa/tasks/mgr/dashboard/test_user.py

index ae7871a827598aca9dfceec4c37cf6e52cbfccf2..0de3f278120757eefc4a2ccf04de87ce0691e346 100644 (file)
@@ -6,7 +6,7 @@ import time
 
 import jwt
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class AuthTest(DashboardTestCase):
index e3a1e908f01e40c2323a403fb11e762555ff8103..24350cced9a86aa3714fa69ef197056c251d284d 100644 (file)
@@ -3,7 +3,7 @@ from __future__ import absolute_import
 
 from contextlib import contextmanager
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class CephfsTest(DashboardTestCase):
index 0473f41a17b7e8998081368c5af8012206309546..798afe9c19c17779009903b2749b3a1feed8ef04 100644 (file)
@@ -2,7 +2,7 @@ from __future__ import absolute_import
 
 import time
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class ClusterConfigurationTest(DashboardTestCase):
index 7237c4de7f349aaf7d5e774ac0a454fca6aa0301..9fcce30f61920365b5a5b29fddd30325d56d1e49 100644 (file)
@@ -4,7 +4,7 @@ from __future__ import absolute_import
 
 import six
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JList
+from .helper import DashboardTestCase, JObj, JList
 
 
 class ECPTest(DashboardTestCase):
index 0311daddaa605d3140a301bb30d40edb13bf81ea..cd869a00e405b2f251fc88f81e4f98fd74e040c2 100644 (file)
@@ -4,7 +4,7 @@
 from __future__ import absolute_import
 
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class GaneshaTest(DashboardTestCase):
index af645933668d25a9465d7c3ed67906a7431e20cc..afc632a6cfa0c954dad7d152ecebc4672f9cd242 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JAny, JLeaf, JList, JObj
+from .helper import DashboardTestCase, JAny, JLeaf, JList, JObj
 
 
 class HealthTest(DashboardTestCase):
index 084e1650a6c7181c36b72c640cbd8dbcffbad1ae..f9acbeff915fc231986f34df36b745349b9408f4 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase, JList, JObj
 
 
 class HostControllerTest(DashboardTestCase):
index 5108161adade100da6adb10d1832731f3b911f0d..17d5d830c99666dd2a628b26d72b23c06820ad9b 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JList, JObj
+from .helper import DashboardTestCase, JList, JObj
 
 
 class LogsTest(DashboardTestCase):
index ec6dbb47f862ca8da114c7d2a27c8d580edb8419..080b8b64c239121110b7bd80565706ad1221ace9 100644 (file)
@@ -4,7 +4,7 @@ from __future__ import absolute_import
 import logging
 import requests
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JAny, JObj, JList, JLeaf
+from .helper import DashboardTestCase, JAny, JObj, JList, JLeaf
 
 logger = logging.getLogger(__name__)
 
index 1558cdc82aff0a9360d9a443f01c3a91b358b42c..0cf7e25a282a6b6e4229eb34ea6095627eedac6c 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class MonitorTest(DashboardTestCase):
index 1481578f997d63460d127c19c3a843088dc731cb..c6c7c5aadd6875737c25a2afb6c5e74beeb8c68a 100644 (file)
@@ -4,7 +4,7 @@ from __future__ import absolute_import
 
 import json
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JAny, JList, JLeaf, JTuple
+from .helper import DashboardTestCase, JObj, JAny, JList, JLeaf, JTuple
 
 
 class OsdTest(DashboardTestCase):
index f1d267ce187d33b2bec9db04a9fd9ab66ef3edd3..c3191dc5e941642552f8b4d9cac46c6b28e70f78 100644 (file)
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj
+from .helper import DashboardTestCase, JObj
 
 
 class PerfCountersControllerTest(DashboardTestCase):
index 1c9f7f1636657b3dba98bb0d2b29ab154e091d98..40a1e20e1265525fa5860ab1e609a86691984dfe 100644 (file)
@@ -6,7 +6,7 @@ import logging
 import six
 import time
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JAny, JList, JObj
+from .helper import DashboardTestCase, JAny, JList, JObj
 
 log = logging.getLogger(__name__)
 
index 7665902e7478d2840a24e146fb7598fd68ee274b..252ca82df32abab79754b6af9bd3df868c72226e 100644 (file)
@@ -5,7 +5,7 @@ from __future__ import absolute_import
 
 import time
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JLeaf, JList
+from .helper import DashboardTestCase, JObj, JLeaf, JList
 
 
 class RbdTest(DashboardTestCase):
index e21b3867d07396a1f38e93c54b0f60bc1d78b8d5..8480cb87a44c071ca7af022f3a62073e12ae680b 100644 (file)
@@ -3,7 +3,7 @@
 
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class RbdMirroringTest(DashboardTestCase):
index 22376c0a29b56fec22541873e89ce8c86d986dc7..0d9f8d9ba83697042c63c18f4b0c1bbc30bd8b0f 100644 (file)
@@ -2,7 +2,7 @@
 
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class RequestsTest(DashboardTestCase):
index 116a1385cf28187d7eb6d9283d90c93afba4dfda..34f337f8df37e7ae1288943dcaf85908527fc225 100644 (file)
@@ -5,7 +5,7 @@ import logging
 import urllib
 import six
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JList, JLeaf
+from .helper import DashboardTestCase, JObj, JList, JLeaf
 
 logger = logging.getLogger(__name__)
 
index e5ecfd590d842e5059c9512195a6769f8e481125..6b0e35b244134e45bb5d46065ded20997fa633b9 100644 (file)
@@ -2,7 +2,7 @@
 
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class RoleTest(DashboardTestCase):
index 5530f6b824409dff0b7cd6cb7fb95dca1a916679..bc0925df223b531047818044e522b868e8be359d 100644 (file)
@@ -2,7 +2,7 @@
 
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JList, JObj, JAny
+from .helper import DashboardTestCase, JList, JObj, JAny
 
 
 class SettingsTest(DashboardTestCase):
index 605ae4cca5584d2c7109e825c2b3ad3ac4e07e2a..1a5d1e9918f949c51a5173e2b9d5d1a4be8f86ba 100644 (file)
@@ -1,6 +1,6 @@
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class SummaryTest(DashboardTestCase):
index 40236546e6321d300861e790d5a615f16c559d98..7af3442d422f0667863923c1df386a2eee88d5c7 100644 (file)
@@ -2,7 +2,7 @@
 
 from __future__ import absolute_import
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 class UserTest(DashboardTestCase):