35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
# Copyright 2016 Mirantis, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
|
|
import os
|
|
import time
|
|
|
|
_boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True,
|
|
'0': False, 'no': False, 'false': False, 'off': False}
|
|
|
|
|
|
def get_var_as_bool(name, default):
|
|
value = os.environ.get(name, '')
|
|
return _boolean_states.get(value.lower(), default)
|
|
|
|
LOGS_DIR = os.environ.get('LOGS_DIR', os.getcwd())
|
|
TIMESTAT_PATH_YAML = os.environ.get(
|
|
'TIMESTAT_PATH_YAML', os.path.join(
|
|
LOGS_DIR, 'timestat_{}.yaml'.format(time.strftime("%Y%m%d"))))
|
|
SSH_NODE_CREDENTIALS = os.environ.get('SSH_NODE_CREDENTIALS',
|
|
{'login': 'test', 'password': 'test'})
|
|
|
|
PRIVATE_REGISTRY = os.environ.get('PRIVATE_REGISTRY', None)
|