Switch from CONST to CONF
[functest.git] / functest / utils / env.py
1 #!/usr/bin/env python
2
3 # Copyright (c) 2018 Orange and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9
10 # pylint: disable=missing-docstring
11
12 import os
13
14 INPUTS = {
15     'EXTERNAL_NETWORK': None,
16     'CI_LOOP': 'daily',
17     'DEPLOY_SCENARIO': 'os-nosdn-nofeature-noha',
18     'INSTALLER_TYPE': None,
19     'SDN_CONTROLLER_IP': None,
20     'BUILD_TAG': None,
21     'NODE_NAME': None,
22     'POD_ARCH': None,
23     'TEST_DB_URL': 'http://testresults.opnfv.org/test/api/v1/results',
24     'ENERGY_RECORDER_API_URL': 'http://energy.opnfv.fr/resources',
25     'ENERGY_RECORDER_API_USER': '',
26     'ENERGY_RECORDER_API_PASSWORD': ''
27 }
28
29
30 def get(env_var):
31     if env_var not in INPUTS.keys():
32         return os.environ.get(env_var, None)
33     return os.environ.get(env_var, INPUTS[env_var])