QVolution2019.2/AoM_Service/AoM_Configs/library/config.py

23 lines
561 B
Python
Executable File

# config.py
import logging
import glob
import yaml
logger = logging.getLogger(__name__)
def glob_the_configs(config_path):
"""
Args:
config_path (string): relative path to the configs
Returns:
List of configs
"""
alert_list = []
for config_file in glob.glob(config_path + "/*.yaml"):
logger.debug("Found {} config".format(config_file))
# LOAD CONFIG
alert_list.append(yaml.load(open(config_file, 'rb').read()))
logger.info("Loaded {} configs".format(len(alert_list)))
return alert_list