def _get_ancestors_by_one_uuid(
        rp_uuid, parent_uuid_by_rp_uuid, ancestors=None):
    """Returns a set of uuids of ancestors for a given rp uuid"""
    if ancestors is None:
        ancestors = set([rp_uuid])
    parent_uuid = parent_uuid_by_rp_uuid[rp_uuid]
    if parent_uuid is None:
        return ancestors
    ancestors.add(parent_uuid)
    return _get_ancestors_by_one_uuid(
        parent_uuid, parent_uuid_by_rp_uuid, ancestors=ancestors)