aboutsummaryrefslogtreecommitdiffstats
path: root/utils/functest_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/functest_utils.py')
-rw-r--r--utils/functest_utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/functest_utils.py b/utils/functest_utils.py
index 285f887c..9a19eb4c 100644
--- a/utils/functest_utils.py
+++ b/utils/functest_utils.py
@@ -309,13 +309,15 @@ def get_criteria_by_test(testname):
# YAML UTILS
#
# -----------------------------------------------------------
-def get_parameter_from_yaml(parameter):
+def get_parameter_from_yaml(parameter, file=None):
"""
Returns the value of a given parameter in config_functest.yaml
parameter must be given in string format with dots
Example: general.openstack.image_name
"""
- with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f:
+ if file is None:
+ file = os.environ["CONFIG_FUNCTEST_YAML"]
+ with open(file) as f:
functest_yaml = yaml.safe_load(f)
f.close()
value = functest_yaml