Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 1 | # Copyright 2016 Mirantis, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | import os |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 15 | import time |
| 16 | |
| 17 | _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True, |
| 18 | '0': False, 'no': False, 'false': False, 'off': False} |
| 19 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 20 | |
| 21 | def get_var_as_bool(name, default): |
| 22 | value = os.environ.get(name, '') |
| 23 | return _boolean_states.get(value.lower(), default) |
| 24 | |
| 25 | |
| 26 | LOGS_DIR = os.environ.get('LOGS_DIR', os.getcwd()) |
| 27 | TIMESTAT_PATH_YAML = os.environ.get( |
| 28 | 'TIMESTAT_PATH_YAML', os.path.join( |
| 29 | LOGS_DIR, 'timestat_{}.yaml'.format(time.strftime("%Y%m%d")))) |
| 30 | |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 31 | VIRTUAL_ENV = os.environ.get("VIRTUAL_ENV", None) |
| 32 | ENV_NAME = os.environ.get("ENV_NAME", None) |
Dennis Dmitriev | 411dd10 | 2017-09-15 16:04:47 +0300 | [diff] [blame^] | 33 | MAKE_SNAPSHOT_STAGES = get_var_as_bool("MAKE_SNAPSHOT_STAGES", True) |
| 34 | SHUTDOWN_ENV_ON_TEARDOWN = get_var_as_bool('SHUTDOWN_ENV_ON_TEARDOWN', True) |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 35 | |
Dennis Dmitriev | 2a13a13 | 2016-11-04 00:56:23 +0200 | [diff] [blame] | 36 | LAB_CONFIG_NAME = os.environ.get('LAB_CONFIG_NAME', 'mk22-lab-basic') |
| 37 | #LAB_CONFIGS_NAME = os.environ.get('LAB_NAME', 'mk22-lab-advanced') |
| 38 | |
Dennis Dmitriev | 9512679 | 2016-10-18 17:03:30 +0300 | [diff] [blame] | 39 | SSH_LOGIN = os.environ.get('SSH_LOGIN', 'root') |
| 40 | SSH_PASSWORD = os.environ.get('SSH_PASSWORD', 'r00tme') |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 41 | SSH_NODE_CREDENTIALS = {"login": SSH_LOGIN, |
| 42 | "password": SSH_PASSWORD} |
| 43 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 44 | # public_iface = IFACES[0] |
| 45 | # private_iface = IFACES[1] |
| 46 | IFACES = [ |
| 47 | os.environ.get("IFACE_0", "eth0"), |
| 48 | os.environ.get("IFACE_1", "eth1"), |
| 49 | ] |
Dmitry Tyzhnenko | 2b730a0 | 2017-04-07 19:31:32 +0300 | [diff] [blame] | 50 | |
| 51 | SALT_USER = os.environ.get('SALT_USER', 'salt') |
| 52 | SALT_PASSWORD = os.environ.get('SALT_PASSWORD', 'hovno12345!') |
Artem Panchenko | edf70ef | 2017-06-13 09:14:34 +0300 | [diff] [blame] | 53 | |
| 54 | DOCKER_REGISTRY = os.environ.get('DOCKER_REGISTRY', |
vrovachev | 8a882d8 | 2017-06-21 12:56:19 +0400 | [diff] [blame] | 55 | 'docker-prod-virtual.docker.mirantis.net') |
Tatyana Leontovich | f8ec90d | 2017-07-18 16:36:16 +0300 | [diff] [blame] | 56 | |
Tatyana Leontovich | 53bd1f9 | 2017-09-08 13:04:42 +0300 | [diff] [blame] | 57 | PATTERN = os.environ.get('PATTERN', None) |
| 58 | RUN_TEMPEST = get_var_as_bool('RUN_TEMPEST', False) |