blob: 5ec518d12fbb12aaa4749a7ac4fbb6db2be6de19 [file] [log] [blame]
Dennis Dmitriev6f59add2016-10-18 13:45:27 +03001# 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.
14import os
15import pkg_resources
16import time
17
18_boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True,
19 '0': False, 'no': False, 'false': False, 'off': False}
20
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030021
22def get_var_as_bool(name, default):
23 value = os.environ.get(name, '')
24 return _boolean_states.get(value.lower(), default)
25
26
27LOGS_DIR = os.environ.get('LOGS_DIR', os.getcwd())
28TIMESTAT_PATH_YAML = os.environ.get(
29 'TIMESTAT_PATH_YAML', os.path.join(
30 LOGS_DIR, 'timestat_{}.yaml'.format(time.strftime("%Y%m%d"))))
31
Dennis Dmitriev2a13a132016-11-04 00:56:23 +020032LAB_CONFIG_NAME = os.environ.get('LAB_CONFIG_NAME', 'mk22-lab-basic')
33#LAB_CONFIGS_NAME = os.environ.get('LAB_NAME', 'mk22-lab-advanced')
34
Dennis Dmitriev95126792016-10-18 17:03:30 +030035SSH_LOGIN = os.environ.get('SSH_LOGIN', 'root')
36SSH_PASSWORD = os.environ.get('SSH_PASSWORD', 'r00tme')
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030037SSH_NODE_CREDENTIALS = {"login": SSH_LOGIN,
38 "password": SSH_PASSWORD}
39
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030040SHUTDOWN_ENV_ON_TEARDOWN = get_var_as_bool('SHUTDOWN_ENV_ON_TEARDOWN', True)
41
42# public_iface = IFACES[0]
43# private_iface = IFACES[1]
44IFACES = [
45 os.environ.get("IFACE_0", "eth0"),
46 os.environ.get("IFACE_1", "eth1"),
47]