[ARVADOS] updated: 1.3.0-2776-g163a40366
Git user
git at public.arvados.org
Mon Jul 13 22:00:17 UTC 2020
Summary of changes:
sdk/python/arvados/commands/federation_migrate.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
via 163a40366283e336d8c8ea3fb9c0bd7322904865 (commit)
via bab30415501b92dbece93b636dda7f6914a123fa (commit)
via 5b8f2940dbb53ef170ab60f025bdbcc824d5d8c4 (commit)
from aa7332d4cf8f44b4ce614293112417b32373cccf (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 163a40366283e336d8c8ea3fb9c0bd7322904865
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Mon Jul 13 18:58:47 2020 -0300
16589: Properly reports error when a name collision happens.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/sdk/python/arvados/commands/federation_migrate.py b/sdk/python/arvados/commands/federation_migrate.py
index 0d39f4fc2..5140d2529 100755
--- a/sdk/python/arvados/commands/federation_migrate.py
+++ b/sdk/python/arvados/commands/federation_migrate.py
@@ -22,6 +22,7 @@ import hmac
import urllib.parse
import os
import hashlib
+import re
from arvados._version import __version__
EMAIL=0
@@ -316,7 +317,12 @@ def migrate_user(args, migratearv, email, new_user_uuid, old_user_uuid):
new_owner_uuid=new_owner_uuid,
redirect_to_new_user=True).execute()
except arvados.errors.ApiError as e:
- print("(%s) Skipping user migration because of error: %s" % (email, e))
+ name_collision = re.search(r'Key \(owner_uuid, name\)=\((.*?), (.*?)\) already exists\.\n.*UPDATE "(.*?)"', e)
+ if name_collision:
+ target_owner, rsc_name, rsc_type = name_collision.groups()
+ print("(%s) Target owner %s already has a %s named '%s', skipping. Please rename it or use --data-into-subproject to migrate all users' data into a special subproject." % (email, target_owner, rsc_type[:-1], rsc_name))
+ else:
+ print("(%s) Skipping user migration because of error: %s" % (email, e))
def main():
commit bab30415501b92dbece93b636dda7f6914a123fa
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Mon Jul 13 18:31:23 2020 -0300
16589: Changes default data migration behavior.
Now all users' data will be moved to the target account's home project unless
--data-into-subproject is used.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/sdk/python/arvados/commands/federation_migrate.py b/sdk/python/arvados/commands/federation_migrate.py
index bbf5056ac..0d39f4fc2 100755
--- a/sdk/python/arvados/commands/federation_migrate.py
+++ b/sdk/python/arvados/commands/federation_migrate.py
@@ -304,7 +304,7 @@ def migrate_user(args, migratearv, email, new_user_uuid, old_user_uuid):
return
try:
new_owner_uuid = new_user_uuid
- if not args.avoid_subproject_creation:
+ if args.data_into_subproject:
grp = migratearv.groups().create(body={
"owner_uuid": new_user_uuid,
"name": "Migrated from %s (%s)" % (email, old_user_uuid),
@@ -325,7 +325,7 @@ def main():
'--version', action='version', version="%s %s" % (sys.argv[0], __version__),
help='Print version and exit.')
parser.add_argument('--tokens', type=str, metavar='FILE', required=False, help="Read tokens from FILE. Not needed when using LoginCluster.")
- parser.add_argument('--avoid-subproject-creation', action="store_true", help="Don't migrate user's data into a separate subproject. This may cause collection or project name collisions from within an account.")
+ parser.add_argument('--data-into-subproject', action="store_true", help="Migrate user's data into a separate subproject. This can be used to avoid name collisions from within an account.")
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--report', type=str, metavar='FILE', help="Generate report .csv file listing users by email address and their associated Arvados accounts.")
group.add_argument('--migrate', type=str, metavar='FILE', help="Consume report .csv and migrate users to designated Arvados accounts.")
commit 5b8f2940dbb53ef170ab60f025bdbcc824d5d8c4
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Mon Jul 13 18:03:44 2020 -0300
16589: Enhances error message when admin status doesn't match.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/sdk/python/arvados/commands/federation_migrate.py b/sdk/python/arvados/commands/federation_migrate.py
index 35655cc0e..bbf5056ac 100755
--- a/sdk/python/arvados/commands/federation_migrate.py
+++ b/sdk/python/arvados/commands/federation_migrate.py
@@ -294,7 +294,7 @@ def activate_remote_user(args, email, homearv, migratearv, old_user_uuid, new_us
return None
if olduser["is_admin"] and not newuser["is_admin"]:
- print("(%s) Not migrating %s because user is admin but target user %s is not admin on %s" % (email, old_user_uuid, new_user_uuid, migratecluster))
+ print("(%s) Not migrating %s because user is admin but target user %s is not admin on %s. Please ensure the user admin status is the same on both clusters" % (email, old_user_uuid, new_user_uuid, migratecluster))
return None
return newuser
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list