import yaml


def read_yml_config(path):
    """Read YAML formatted configuration file.

    Args:
        path (str): path to configuration file to read

    Returns:
        dict: machines with attributes

    """
    with open(path, 'rt') as f:
        data = yaml.load(f.read(), Loader=yaml.Loader)
    # Machines are entries with a 'mac' attribute
    data = {machine: desc for machine, desc in data.items() if 'mac' in desc}
    return data