提交 06d9372d 编写于 作者: C Cleber Rosa

avocado/core/data_dir.py: simplify in tree test dir

Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 db41b9cb
...@@ -26,7 +26,6 @@ The general reasoning to find paths is: ...@@ -26,7 +26,6 @@ The general reasoning to find paths is:
* The next best location is the default user specific one. * The next best location is the default user specific one.
""" """
import os import os
import sys
import shutil import shutil
import time import time
import tempfile import tempfile
...@@ -37,10 +36,6 @@ from .output import LOG_JOB ...@@ -37,10 +36,6 @@ from .output import LOG_JOB
from ..utils import path as utils_path from ..utils import path as utils_path
from ..utils.data_structures import Borg from ..utils.data_structures import Borg
_BASE_DIR = os.path.join(sys.modules[__name__].__file__, "..", "..", "..")
_BASE_DIR = os.path.abspath(_BASE_DIR)
_IN_TREE_TESTS_DIR = os.path.join(_BASE_DIR, 'examples', 'tests')
SYSTEM_BASE_DIR = '/var/lib/avocado' SYSTEM_BASE_DIR = '/var/lib/avocado'
if 'VIRTUAL_ENV' in os.environ: if 'VIRTUAL_ENV' in os.environ:
SYSTEM_BASE_DIR = os.environ['VIRTUAL_ENV'] SYSTEM_BASE_DIR = os.environ['VIRTUAL_ENV']
...@@ -109,7 +104,8 @@ def get_test_dir(): ...@@ -109,7 +104,8 @@ def get_test_dir():
return configured return configured
if settings.settings.intree: if settings.settings.intree:
return _IN_TREE_TESTS_DIR base_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
return os.path.join(base_dir, 'examples', 'tests')
if utils_path.usable_ro_dir(SYSTEM_TEST_DIR): if utils_path.usable_ro_dir(SYSTEM_TEST_DIR):
return SYSTEM_TEST_DIR return SYSTEM_TEST_DIR
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册