def _find_config(pav_cfg, conf_type, conf_name):
    """Search all of the known configuration directories for a config of the
    given type and name.
    :param pav_cfg: The pavilion config data.
    :param str conf_type: 'host', 'mode', or 'test'
    :param str conf_name: The name of the config (without a file extension).
    :return: The path to the first matching config found, or None if one wasn't
    found.
    """
    for conf_dir in pav_cfg.config_dirs:
        path = conf_dir/conf_type/'{}.yaml'.format(conf_name)
        if path.exists():
            return path

    return None