[ARVADOS] updated: 1.3.0-2378-gb29897f6c
Git user
git at public.arvados.org
Fri Mar 27 21:09:35 UTC 2020
Summary of changes:
lib/controller/federation/conn.go | 2 +-
sdk/go/arvados/api.go | 1 +
sdk/python/arvados/commands/federation_migrate.py | 6 +++---
services/api/app/controllers/arvados/v1/users_controller.rb | 6 ++++++
4 files changed, 11 insertions(+), 4 deletions(-)
via b29897f6c80db4a2b98f84fe6c2fcab98117efd2 (commit)
from 12b5341528770adc532b6c3e169036addd945d52 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit b29897f6c80db4a2b98f84fe6c2fcab98117efd2
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Fri Mar 27 17:08:48 2020 -0400
16263: Add local_user_list flag to bypass LoginCluster behavior
Required by federation migrate script.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index c6f6b2c97..6cd595e15 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -367,7 +367,7 @@ var userAttrsCachedFromLoginCluster = map[string]bool{
func (conn *Conn) UserList(ctx context.Context, options arvados.ListOptions) (arvados.UserList, error) {
logger := ctxlog.FromContext(ctx)
- if id := conn.cluster.Login.LoginCluster; id != "" && id != conn.cluster.ClusterID {
+ if id := conn.cluster.Login.LoginCluster; id != "" && id != conn.cluster.ClusterID && !options.LocalUserList {
resp, err := conn.chooseBackend(id).UserList(ctx, options)
if err != nil {
return resp, err
diff --git a/sdk/go/arvados/api.go b/sdk/go/arvados/api.go
index 4eb5b61b3..7bb3bfaa7 100644
--- a/sdk/go/arvados/api.go
+++ b/sdk/go/arvados/api.go
@@ -84,6 +84,7 @@ type ListOptions struct {
Count string `json:"count"`
IncludeTrash bool `json:"include_trash"`
IncludeOldVersions bool `json:"include_old_versions"`
+ LocalUserList bool `json:"local_user_list"`
}
type CreateOptions struct {
diff --git a/sdk/python/arvados/commands/federation_migrate.py b/sdk/python/arvados/commands/federation_migrate.py
index e74d6215c..b66aa5d7c 100755
--- a/sdk/python/arvados/commands/federation_migrate.py
+++ b/sdk/python/arvados/commands/federation_migrate.py
@@ -98,7 +98,7 @@ def fetch_users(clusters, loginCluster):
users = []
for c, arv in clusters.items():
print("Getting user list from %s" % c)
- ul = arvados.util.list_all(arv.users().list)
+ ul = arvados.util.list_all(arv.users().list, local_user_list=True)
for l in ul:
if l["uuid"].startswith(c):
users.append(l)
@@ -171,7 +171,7 @@ def update_username(args, email, user_uuid, username, migratecluster, migratearv
print("(%s) Updating username of %s to '%s' on %s" % (email, user_uuid, username, migratecluster))
if not args.dry_run:
try:
- conflicts = migratearv.users().list(filters=[["username", "=", username]]).execute()
+ conflicts = migratearv.users().list(filters=[["username", "=", username]], local_user_list=True).execute()
if conflicts["items"]:
migratearv.users().update(uuid=conflicts["items"][0]["uuid"], body={"user": {"username": username+"migrate"}}).execute()
migratearv.users().update(uuid=user_uuid, body={"user": {"username": username}}).execute()
@@ -204,7 +204,7 @@ def choose_new_user(args, by_email, email, userhome, username, old_user_uuid, cl
user = None
try:
olduser = oldhomearv.users().get(uuid=old_user_uuid).execute()
- conflicts = homearv.users().list(filters=[["username", "=", username]]).execute()
+ conflicts = homearv.users().list(filters=[["username", "=", username]], local_user_list=True).execute()
if conflicts["items"]:
homearv.users().update(uuid=conflicts["items"][0]["uuid"], body={"user": {"username": username+"migrate"}}).execute()
user = homearv.users().create(body={"user": {"email": email, "username": username, "is_active": olduser["is_active"]}}).execute()
diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb
index 289e82567..9439493df 100644
--- a/services/api/app/controllers/arvados/v1/users_controller.rb
+++ b/services/api/app/controllers/arvados/v1/users_controller.rb
@@ -257,6 +257,12 @@ class Arvados::V1::UsersController < ApplicationController
}
end
+ def self._index_requires_parameters
+ super.merge(
+ { local_user_list: {required: false, type: 'boolean',
+ description: 'only list users from local database, no effect if LoginCluster is not set'} })
+ end
+
def apply_filters(model_class=nil)
return super if @read_users.any?(&:is_admin)
if params[:uuid] != current_user.andand.uuid
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list