def lookup_id_from_name(name, cfg):
    """
        Return ID key from an name in an config dict.
        :param str name: The string to lookup in an key 'name'.
        :param list cfg: The list of dicts to lookup 'id' from an 'name'.
        :return: The ID match with the 'name' string, or 0 if not found.
        :rtype : Integer
    """
    try:
        cfg_id = filter(lambda c: c['name'] == name, cfg)[0]['id']
    except:
        cfg_id = 0
    return cfg_id
