savex | 4448e13 | 2018-04-25 15:51:14 +0200 | [diff] [blame^] | 1 | """ |
| 2 | Base configuration module |
| 3 | Gathers env values and supplies default ones |
| 4 | |
| 5 | Attributes: |
| 6 | base_config: class with all of the values prepared to work with env |
| 7 | """ |
| 8 | |
| 9 | import os |
| 10 | |
| 11 | from check_versions.common.other import utils |
| 12 | |
| 13 | PKG_DIR = os.path.dirname(__file__) |
| 14 | PKG_DIR = os.path.join(PKG_DIR, os.pardir, os.pardir) |
| 15 | PKG_DIR = os.path.normpath(PKG_DIR) |
| 16 | |
| 17 | _default_work_folder = os.path.normpath(PKG_DIR) |
| 18 | |
| 19 | |
| 20 | class 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 | |
| 44 | base_config = TestsConfigurationBase() |