Merge "Use functest repo variable"
[functest.git] / functest / utils / functest_utils.py
index e84a2b4..38a60d4 100644 (file)
@@ -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
 
 
@@ -157,14 +157,13 @@ def get_parameter_from_yaml(parameter, yfile):
 
 
 def get_functest_config(parameter):
-    yaml_ = constants.CONST.__getattribute__('CONFIG_FUNCTEST_YAML')
+    yaml_ = constants.CONFIG_FUNCTEST_YAML
     return get_parameter_from_yaml(parameter, yaml_)
 
 
 def get_functest_yaml():
     # pylint: disable=bad-continuation
-    with open(constants.CONST.__getattribute__(
-            'CONFIG_FUNCTEST_YAML')) as yaml_fd:
+    with open(constants.CONFIG_FUNCTEST_YAML) as yaml_fd:
         functest_yaml = yaml.safe_load(yaml_fd)
     return functest_yaml