cold
This commit is contained in:
22
AoM_Service/AoM_Configs/library/config.py
Executable file
22
AoM_Service/AoM_Configs/library/config.py
Executable file
@@ -0,0 +1,22 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user