diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2022-03-03 15:29:16 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2022-03-04 10:32:25 +0100 |
commit | 5ab58cf461b7803e4c9c5c0983e8c397468d27a8 (patch) | |
tree | 850337598a8aa666f40761ddeb12485137b22e25 /xtesting/utils/constants.py | |
parent | 98189214d82232f8a24a3a53c9033cd782157635 (diff) |
Search config files in tree
It allows putting configurations in classical dirs.
It fallbacks to the python package for backward compatibility.
Change-Id: Ie33b9482fb197926c7d7d66ace815fa4ae01d02d
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/utils/constants.py')
-rw-r--r-- | xtesting/utils/constants.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/xtesting/utils/constants.py b/xtesting/utils/constants.py index acd0d31d..f5e29e0d 100644 --- a/xtesting/utils/constants.py +++ b/xtesting/utils/constants.py @@ -1,14 +1,33 @@ #!/usr/bin/env python +# Copyright (c) 2019 Orange and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 + # pylint: disable=missing-docstring import os +import sys + +import pkg_resources ENV_FILE = '/var/lib/xtesting/conf/env_file' +XTESTING_PATHES = [ + "~/.xtesting", "/etc/xtesting", os.path.join(sys.prefix + "/etc/xtesting")] + +TESTCASE_DESCRIPTION = 'testcases.yaml' +TESTCASE_DESCRIPTION_DEFAULT = pkg_resources.resource_filename( + 'xtesting', f'ci/{TESTCASE_DESCRIPTION}') + RESULTS_DIR = '/var/lib/xtesting/results' LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.log') DEBUG_LOG_PATH = os.path.join(RESULTS_DIR, 'xtesting.debug.log') -INI_PATH = 'ci/logging.ini' -DEBUG_INI_PATH = 'ci/logging.debug.ini' +INI_PATH_DEFAULT = pkg_resources.resource_filename( + 'xtesting', 'ci/logging.ini') +DEBUG_INI_PATH_DEFAULT = pkg_resources.resource_filename( + 'xtesting', 'ci/logging.debug.ini') |