def load_config(filename):
    logger.debug("Event Definitions configuration file: %s", filename)

    with open(filename, 'r') as cf:
        config = cf.read()

    try:
        events_config = yaml.safe_load(config)
    except yaml.YAMLError as err:
        if hasattr(err, 'problem_mark'):
            mark = err.problem_mark
            errmsg = ("Invalid YAML syntax in Event Definitions file "
                      "%(file)s at line: %(line)s, column: %(column)s."
                      % dict(file=filename,
                             line=mark.line + 1,
                             column=mark.column + 1))
        else:
            errmsg = ("YAML error reading Event Definitions file "
                      "%(file)s"
                      % dict(file=filename))
        logger.error(errmsg)
        raise

    logger.info("Event Definitions: %s", events_config)
    return events_config
Remove review branch and tracking branch.
dataset/ETHPy150Open openstack/stacktach-stackdistiller/stackdistiller/distiller.py/load_config--crossover with--dataset/ETHPy150Open bloomberg/phabricator-tools/py/abd/abdt_branch.py/Branch.remove