def normalize_roles(roles):
    ret = [
        dict(
            id=role.get('id'),
            name=role.get('name'),
        ) for role in roles
    ]
    return meta.obj_list_to_dict(ret)
Normalize Identity roles.
dataset/ETHPy150Open openstack-infra/shade/shade/_utils.py/normalize_roles