def parse_configs():
"""Parses config files out of config/ directory.
Returns:
Array of MergeBotConfig objects.
"""
configs = []
yaml.add_constructor(u'!MergeBotConfig', mergebotconfig_constructor)
l.info('Parsing Config Files')
for filename in glob.iglob('config/*.yaml'):
with open(filename) as cfg:
try:
l.info('Opening {}'.format(filename))
config = yaml.load(cfg)
l.info('{} Successfully Read'.format(filename))
configs.append(config)
except yaml.YAMLError as exc:
l.fatal(
'Error parsing file {filename}: {exc}. Please fix and try '
'again.'.format(filename=filename, exc=exc))
return configs
评论列表
文章目录