]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Thu, 26 Mar 2020 06:37:06 +0000 (14:37 +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>
23 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_crush_rule.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_orchestrator.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 468fe379641ced23f59e731ff1ed4736fca7cca0..e76708a9c43beed7f7123f5355db7c7745ff9afe 100644 (file)
@@ -6,7 +6,7 @@ import time
 
 import jwt
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JLeaf
+from .helper import DashboardTestCase, JObj, JLeaf
 
 
 class AuthTest(DashboardTestCase):
index 291d4d85c93c9ec7559460b5e4c16c9256f9e8d6..e6594450f714177b6833de5b502f35db43ec09fc 100644 (file)
@@ -4,7 +4,7 @@ from __future__ import absolute_import
 import six
 from contextlib import contextmanager
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JList, JLeaf
+from .helper import DashboardTestCase, JObj, JList, JLeaf
 
 
 class CephfsTest(DashboardTestCase):
index 9f134cd876aecfd0d2bd584d5bfcbd0d6f4b74d2..61d18000a45a4078a389d9213d4c59ccdb7f5c96 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 33949925bb04f55b1529f563c4de5a22dce36bce..a0bca63ff4a038be1cadff5fcd52c54745e6b2ba 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 CrushRuleTest(DashboardTestCase):
index 8e93c8ec584f5e7b20b52ed55ff1c4c980cb1697..111e37c7e3e66dfdc71017341122de5bcb67cb53 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 e7bfb4fabf001f1c65b81520aa152013f0854cb5..08551e488ab99164f79afe1e1cd9302c75c30b1d 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 407207133e3bac02230be87e2639e20d7780bc0d..d608dc247ed565244b1797f100d324409e1597cd 100644 (file)
@@ -2,8 +2,8 @@
 from __future__ import absolute_import
 import json
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JList, JObj
-from tasks.mgr.dashboard.test_orchestrator import test_data
+from .helper import DashboardTestCase, JList, JObj
+from .test_orchestrator import test_data
 
 
 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 4f248a1c3c6b9b37c52affdf92654403fb0208b7..9f4204379ac9afd9518a34134f4f9410683efc6d 100644 (file)
@@ -2,7 +2,7 @@
 from __future__ import absolute_import
 import json
 
-from tasks.mgr.dashboard.helper import DashboardTestCase
+from .helper import DashboardTestCase
 
 
 test_data = {
index 4f2028d2297ef473744541fbfb737a351d40ef30..1bd75e4b09472547d730064e591bc6ddbfdb0b71 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 327bec6a0c08f19ccb68ff43d62c20a37c4a0458..969318d2a94b3b79496cf1396cf7e992ecd05093 100644 (file)
@@ -6,7 +6,7 @@ import six
 import time
 from contextlib import contextmanager
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JAny, JList, JObj
+from .helper import DashboardTestCase, JAny, JList, JObj
 
 log = logging.getLogger(__name__)
 
index 5d82aa3d18e7feacee05ea8c4e38dc9bd035e8a8..a3ef00b1b7f0e53e8348978919f653a4480d3962 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 f8268f3525bf658af026495f73061b2d03405935..39e5f895f11085271b22a7d1f1dcf9db007ef8b9 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 0d75e63f5e00f6f1987a845e6d7cd8b456c6725d..9cb3504b5ae3522d3b69ea1781dadc72d1330db3 100644 (file)
@@ -10,7 +10,7 @@ from cryptography.hazmat.backends import default_backend
 from cryptography.hazmat.primitives.twofactor.totp import TOTP
 from cryptography.hazmat.primitives.hashes import SHA1
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JList, JLeaf
+from .helper import DashboardTestCase, JObj, JList, JLeaf
 
 logger = logging.getLogger(__name__)
 
index d678fa195f55eeb5393f12aa5d2f6ffb2ac43234..dbfaea9e4f2d4308ae3326ad1082193611d158e2 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 4c6ebeacaaebb1a7644b87fe05ab0a18729d24ce..2d890484a3e04f09326a926ee18c995376709bc2 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 808107a3119e841dcbad9d6df04ae22809805521..a31f8914673664e6f8f682ca4a74bfa6f7ddcbdb 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 f3606ed851870ed6a180632944250007458b5abc..ea7beee6d7a50239aa72b9235f21a3258049cc70 100644 (file)
@@ -6,7 +6,7 @@ import time
 
 from datetime import datetime, timedelta
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JLeaf
+from .helper import DashboardTestCase, JObj, JLeaf
 
 
 class UserTest(DashboardTestCase):