From d589e4e5345ed82c68d9a011ac89f8cdbefe2ca3 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 14 Feb 2018 16:02:53 +0100 Subject: Get properly env vars or their default values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It defines env.get() as an unique way to get Functest env vars or their default values. It can be considered as a wrapper above os.environ. It enforces backward compatibility via CONST which mustn't be used for that purpose. It should be noted that it also stops using CONST for getting OpenStack env vars. Change-Id: I333dc1afbc0123166a7eaff8b551370098efa341 Signed-off-by: Cédric Ollivier --- functest/utils/functest_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'functest/utils/functest_utils.py') diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index e84a2b426..b31b392d7 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -11,7 +11,6 @@ from __future__ import print_function import logging -import os import re import shutil import subprocess @@ -22,6 +21,7 @@ from six.moves import urllib import yaml from functest.utils import constants +from functest.utils import env LOGGER = logging.getLogger(__name__) @@ -90,8 +90,8 @@ def get_ci_envvars(): Get the CI env variables """ ci_env_var = { - "installer": os.environ.get('INSTALLER_TYPE'), - "scenario": os.environ.get('DEPLOY_SCENARIO')} + "installer": env.get('INSTALLER_TYPE'), + "scenario": env.get('DEPLOY_SCENARIO')} return ci_env_var -- cgit 1.2.3-korg