def parse(filename):
"""
Parse a YAML file
"""
try:
with open(filename) as f:
try:
return yaml.load(f)
except yaml.YAMLError as e:
log.critical("Problem parsing {} as YAML: {}".format(
filename, e))
return None
except FileNotFoundError:
log.critical("Problem opening {}: File was not found".format(filename))
return None
评论列表
文章目录