X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/95d0775bf6fa098871961fadb30aa4b052c6aa61..20d7f7ebaaf9e1841d48a5048df8a7193b7c9a8e:/sdk/python/arvados/commands/federation_migrate.py diff --git a/sdk/python/arvados/commands/federation_migrate.py b/sdk/python/arvados/commands/federation_migrate.py index 32b3211f14..770e1609db 100755 --- a/sdk/python/arvados/commands/federation_migrate.py +++ b/sdk/python/arvados/commands/federation_migrate.py @@ -97,13 +97,12 @@ def fetch_users(clusters, loginCluster): by_email = {} by_username = {} - users = [] - for c, arv in clusters.items(): - print("Getting user list from %s" % c) - ul = arvados.util.list_all(arv.users().list, bypass_federation=True) - for l in ul: - if l["uuid"].startswith(c): - users.append(l) + users = [ + user + for prefix, arv in clusters.items() + for user in arvados.util.keyset_list_all(arv.users().list, bypass_federation=True) + if user['uuid'].startswith(prefix) + ] # Users list is sorted by email # Go through users and collect users with same email @@ -111,7 +110,7 @@ def fetch_users(clusters, loginCluster): # call add_accum_rows() to generate the report rows with # the "home cluster" set, and also fill in the by_email table. - users = sorted(users, key=lambda u: u["email"]+"::"+(u["username"] or "")+"::"+u["uuid"]) + users.sort(key=lambda u: (u["email"], u["username"] or "", u["uuid"])) accum = [] lastemail = None