blob: 937c22e7e7dfdbe4e7b671213ea98d80b95c81bc [file] [log] [blame]
savex4448e132018-04-25 15:51:14 +02001"""
2Base configuration module
3Gathers env values and supplies default ones
4
5Attributes:
6 base_config: class with all of the values prepared to work with env
7"""
8
9import os
10
11from check_versions.common.other import utils
12
13PKG_DIR = os.path.dirname(__file__)
14PKG_DIR = os.path.join(PKG_DIR, os.pardir, os.pardir)
15PKG_DIR = os.path.normpath(PKG_DIR)
16
17_default_work_folder = os.path.normpath(PKG_DIR)
18
19
20class TestsConfigurationBase(object):
21 """
22 Base configuration class. Only values that are common for all scripts
23 """
24
25 name = "CiTestsBaseConfig"
26 logfile_name = 'ci_packages.log'
27 working_folder = os.environ.get('CI_TESTS_WORK_DIR', _default_work_folder)
28 salt_host = os.environ.get('SALT_URL', None)
29 salt_port = os.environ.get('SALT_PORT', '6969')
30 salt_user = os.environ.get('SALT_USER', 'salt')
31 salt_pass = os.environ.get('SALT_PASSWORD', None)
32
33 salt_timeout = os.environ.get('SALT_TIMEOUT', 30)
34 salt_file_root = os.environ.get('SALT_FILE_ROOT', None)
35 salt_scripts_folder = os.environ.get('SALT_SCRIPTS_FOLDER', 'test_scripts')
36
37 all_nodes = utils.get_nodes_list(os.environ.get('CI_ALL_NODES', None))
38 skip_nodes = utils.node_string_to_list(os.environ.get(
39 'CI_SKIP_NODES',
40 None
41 ))
42
43
44base_config = TestsConfigurationBase()