From ef2813a0683e15dcedfe747f7dd2e55dc76cc832 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Mon, 13 Jul 2020 12:35:50 +0800 Subject: [PATCH] CI: Improve load env config log output --- tools/ci/python_packages/tiny_test_fw/EnvConfig.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/ci/python_packages/tiny_test_fw/EnvConfig.py b/tools/ci/python_packages/tiny_test_fw/EnvConfig.py index 1f7a75511e..f51380b9f5 100644 --- a/tools/ci/python_packages/tiny_test_fw/EnvConfig.py +++ b/tools/ci/python_packages/tiny_test_fw/EnvConfig.py @@ -31,6 +31,7 @@ Config file format is yaml. it's a set of key-value pair. The following is an ex It will first define the env tag for each environment, then add its key-value pairs. This will prevent test cases from getting configs from other env when there're configs for multiple env in one file. """ +import logging import yaml @@ -60,6 +61,9 @@ class Config(object): configs = yaml.load(f, Loader=Loader)[env_name] except (OSError, TypeError, IOError): configs = dict() + except KeyError: + logging.error('No config env "{}" in config file "{}"'.format(env_name, config_file)) + raise return configs def get_variable(self, variable_name):