summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2016-12-14 09:18:10 +0000
committerxudan <xudan16@huawei.com>2016-12-15 01:06:56 +0000
commit2ae61333cb9dae3bc8d5da567323b05ebe2f1108 (patch)
tree8a74b2d737cf8e2c58314d70f87c5cf17b98cf71
parent004634d4ce99da007228293877e3dd1e179b02ec (diff)
dovetail tool: move conf/dovetail_config.py into utils/
1. move conf/dovetail_config.py into utils/ 2. change the open file path in dovetail_config.py 3. do some modification about all 'from conf.dovetail_config import ***' JIRA: DOVETAIL-158 Change-Id: I7670e6de993899e4e2a604cbc501dc3339896ef1 Signed-off-by: xudan <xudan16@huawei.com>
-rw-r--r--dovetail/container.py2
-rw-r--r--dovetail/parser.py2
-rw-r--r--dovetail/report.py2
-rwxr-xr-xdovetail/run.py2
-rw-r--r--dovetail/testcase.py2
-rw-r--r--dovetail/tests/unit/test_parser.py2
-rw-r--r--dovetail/utils/dovetail_config.py (renamed from dovetail/conf/dovetail_config.py)7
-rw-r--r--dovetail/utils/dovetail_logger.py2
8 files changed, 11 insertions, 10 deletions
diff --git a/dovetail/container.py b/dovetail/container.py
index 87174727..948dce93 100644
--- a/dovetail/container.py
+++ b/dovetail/container.py
@@ -10,7 +10,7 @@
import utils.dovetail_logger as dt_logger
import utils.dovetail_utils as dt_utils
-from conf.dovetail_config import DovetailConfig as dt_cfg
+from utils.dovetail_config import DovetailConfig as dt_cfg
class Container:
diff --git a/dovetail/parser.py b/dovetail/parser.py
index ad969bc2..b00b0f89 100644
--- a/dovetail/parser.py
+++ b/dovetail/parser.py
@@ -12,7 +12,7 @@ import jinja2
import utils.dovetail_logger as dt_logger
import utils.dovetail_utils as dt_utils
-from conf.dovetail_config import DovetailConfig as dt_cfg
+from utils.dovetail_config import DovetailConfig as dt_cfg
class Parser:
diff --git a/dovetail/report.py b/dovetail/report.py
index 1f970b29..bee84041 100644
--- a/dovetail/report.py
+++ b/dovetail/report.py
@@ -17,7 +17,7 @@ import uuid
import utils.dovetail_logger as dt_logger
-from conf.dovetail_config import DovetailConfig as dt_cfg
+from utils.dovetail_config import DovetailConfig as dt_cfg
from testcase import Testcase
diff --git a/dovetail/run.py b/dovetail/run.py
index c0cc872c..368ea675 100755
--- a/dovetail/run.py
+++ b/dovetail/run.py
@@ -22,7 +22,7 @@ from testcase import Testsuite
from report import Report
from report import FunctestCrawler, YardstickCrawler
from report import FunctestChecker, YardstickChecker
-from conf.dovetail_config import DovetailConfig as dt_cfg
+from utils.dovetail_config import DovetailConfig as dt_cfg
from test_runner import DockerRunner, ShellRunner
diff --git a/dovetail/testcase.py b/dovetail/testcase.py
index 6f2d76de..4310f9b4 100644
--- a/dovetail/testcase.py
+++ b/dovetail/testcase.py
@@ -13,7 +13,7 @@ import yaml
import utils.dovetail_logger as dt_logger
from parser import Parser
-from conf.dovetail_config import DovetailConfig as dt_cfg
+from utils.dovetail_config import DovetailConfig as dt_cfg
from test_runner import TestRunnerFactory
diff --git a/dovetail/tests/unit/test_parser.py b/dovetail/tests/unit/test_parser.py
index 410a6629..73ed2b72 100644
--- a/dovetail/tests/unit/test_parser.py
+++ b/dovetail/tests/unit/test_parser.py
@@ -25,7 +25,7 @@ class TestParser(unittest.TestCase):
def setUp(self):
"""Test case setup"""
- from conf.dovetail_config import DovetailConfig as dt_cfg
+ from utils.dovetail_config import DovetailConfig as dt_cfg
dt_cfg.load_config_files()
dovetail_parser.Parser.create_log()
logging.disable(logging.CRITICAL)
diff --git a/dovetail/conf/dovetail_config.py b/dovetail/utils/dovetail_config.py
index 1087bdc5..33cf57be 100644
--- a/dovetail/conf/dovetail_config.py
+++ b/dovetail/utils/dovetail_config.py
@@ -25,15 +25,16 @@ class DovetailConfig:
@classmethod
def load_config_files(cls):
curr_path = os.path.dirname(os.path.abspath(__file__))
- with open(os.path.join(curr_path, 'dovetail_config.yml')) as f:
+ config_path = os.path.join(os.path.dirname(curr_path), 'conf')
+ with open(os.path.join(config_path, 'dovetail_config.yml')) as f:
cls.dovetail_config = yaml.safe_load(f)
for extra_config_file in cls.dovetail_config['include_config']:
- with open(os.path.join(curr_path, extra_config_file)) as f:
+ with open(os.path.join(config_path, extra_config_file)) as f:
extra_config = yaml.safe_load(f)
cls.dovetail_config.update(extra_config)
- path = os.path.join(curr_path, cls.dovetail_config['cli_file_name'])
+ path = os.path.join(config_path, cls.dovetail_config['cli_file_name'])
with open(path) as f:
cmd_yml = yaml.safe_load(f)
cls.dovetail_config['cli'] = cmd_yml[cmd_yml.keys()[0]]
diff --git a/dovetail/utils/dovetail_logger.py b/dovetail/utils/dovetail_logger.py
index bb09a7b1..685db8f7 100644
--- a/dovetail/utils/dovetail_logger.py
+++ b/dovetail/utils/dovetail_logger.py
@@ -24,7 +24,7 @@
import logging
import os
-from conf.dovetail_config import DovetailConfig as dt_cfg
+from dovetail_config import DovetailConfig as dt_cfg
class Logger: