From 7d37226548a1d543bd0cdba916f3e00730a91797 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 27 Mar 2020 13:57:37 +0800 Subject: [PATCH] qa/tasks/mgr: use relative import for better readability, and to ease the pain of developer to track back to the top level python package for referencing a submodule Signed-off-by: Kefu Chai --- qa/tasks/mgr/test_crash.py | 7 +++---- qa/tasks/mgr/test_dashboard.py | 6 ++---- qa/tasks/mgr/test_failover.py | 2 +- qa/tasks/mgr/test_insights.py | 3 ++- qa/tasks/mgr/test_module_selftest.py | 3 ++- qa/tasks/mgr/test_orchestrator_cli.py | 2 +- qa/tasks/mgr/test_progress.py | 2 +- qa/tasks/mgr/test_prometheus.py | 3 +-- 8 files changed, 13 insertions(+), 15 deletions(-) diff --git a/qa/tasks/mgr/test_crash.py b/qa/tasks/mgr/test_crash.py index aeeb89e9814fc..16663f4cd85d1 100644 --- a/qa/tasks/mgr/test_crash.py +++ b/qa/tasks/mgr/test_crash.py @@ -1,11 +1,10 @@ - - -from tasks.mgr.mgr_test_case import MgrTestCase - import json import logging import datetime +from .mgr_test_case import MgrTestCase + + log = logging.getLogger(__name__) UUID = 'd5775432-0742-44a3-a435-45095e32e6b1' DATEFMT = '%Y-%m-%d %H:%M:%S.%f' diff --git a/qa/tasks/mgr/test_dashboard.py b/qa/tasks/mgr/test_dashboard.py index 44b6602a6da3a..5e9b3829b2a6e 100644 --- a/qa/tasks/mgr/test_dashboard.py +++ b/qa/tasks/mgr/test_dashboard.py @@ -1,10 +1,8 @@ - - -from tasks.mgr.mgr_test_case import MgrTestCase - import logging import requests +from .mgr_test_case import MgrTestCase + log = logging.getLogger(__name__) diff --git a/qa/tasks/mgr/test_failover.py b/qa/tasks/mgr/test_failover.py index bdadf019bc076..a4e840883f90d 100644 --- a/qa/tasks/mgr/test_failover.py +++ b/qa/tasks/mgr/test_failover.py @@ -2,7 +2,7 @@ import logging import json -from tasks.mgr.mgr_test_case import MgrTestCase +from .mgr_test_case import MgrTestCase log = logging.getLogger(__name__) diff --git a/qa/tasks/mgr/test_insights.py b/qa/tasks/mgr/test_insights.py index 423a4a8feae7e..9f952152c695d 100644 --- a/qa/tasks/mgr/test_insights.py +++ b/qa/tasks/mgr/test_insights.py @@ -3,7 +3,8 @@ import json import datetime import time -from tasks.mgr.mgr_test_case import MgrTestCase +from .mgr_test_case import MgrTestCase + log = logging.getLogger(__name__) UUID = 'd5775432-0742-44a3-a435-45095e32e6b2' diff --git a/qa/tasks/mgr/test_module_selftest.py b/qa/tasks/mgr/test_module_selftest.py index 63cf39a3b7af6..69492256daaa9 100644 --- a/qa/tasks/mgr/test_module_selftest.py +++ b/qa/tasks/mgr/test_module_selftest.py @@ -5,7 +5,8 @@ import errno import logging from teuthology.exceptions import CommandFailedError -from tasks.mgr.mgr_test_case import MgrTestCase +from .mgr_test_case import MgrTestCase + log = logging.getLogger(__name__) diff --git a/qa/tasks/mgr/test_orchestrator_cli.py b/qa/tasks/mgr/test_orchestrator_cli.py index db922632374ea..c6d229f311d3d 100644 --- a/qa/tasks/mgr/test_orchestrator_cli.py +++ b/qa/tasks/mgr/test_orchestrator_cli.py @@ -5,7 +5,7 @@ from time import sleep from teuthology.exceptions import CommandFailedError -from tasks.mgr.mgr_test_case import MgrTestCase +from .mgr_test_case import MgrTestCase log = logging.getLogger(__name__) diff --git a/qa/tasks/mgr/test_progress.py b/qa/tasks/mgr/test_progress.py index 40cd3a0cab689..16e5df1706121 100644 --- a/qa/tasks/mgr/test_progress.py +++ b/qa/tasks/mgr/test_progress.py @@ -3,7 +3,7 @@ import json import logging import time -from tasks.mgr.mgr_test_case import MgrTestCase +from .mgr_test_case import MgrTestCase log = logging.getLogger(__name__) diff --git a/qa/tasks/mgr/test_prometheus.py b/qa/tasks/mgr/test_prometheus.py index 867d5cd5d6d6d..63a4abe00dbba 100644 --- a/qa/tasks/mgr/test_prometheus.py +++ b/qa/tasks/mgr/test_prometheus.py @@ -1,9 +1,8 @@ -from tasks.mgr.mgr_test_case import MgrTestCase - import json import logging import requests +from .mgr_test_case import MgrTestCase log = logging.getLogger(__name__) -- 2.39.5