def _get_rid_for_name(entries, name):
    """Get the rid of the entry with the given name."""
    for entry in entries.values():
        if entry['name'] == name:
            return entry['rid']

    raise ValueError(u'No entry with name {} found in entries {}'.format(name, entries))