- new_collection = re.search(r"Migrated uuid is ([a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15})", out)
- api_client.links().create(body={"link": {
- 'owner_uuid': col.api_response()["owner_uuid"],
- 'link_class': arvados.commands.keepdocker._migration_link_class,
- 'name': arvados.commands.keepdocker._migration_link_name,
- 'tail_uuid': old_image["collection"],
- 'head_uuid': new_collection.group(1)
- }}).execute(num_retries=3)
-
- logger.info("Migrated '%s' to '%s'", old_image["collection"], new_collection.group(1))
+ migrated = re.search(r"Migrated uuid is ([a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15})", out)
+ if migrated:
+ newcol = CollectionReader(migrated.group(1))
+
+ api_client.links().create(body={"link": {
+ 'owner_uuid': oldcol.api_response()["owner_uuid"],
+ 'link_class': arvados.commands.keepdocker._migration_link_class,
+ 'name': arvados.commands.keepdocker._migration_link_name,
+ 'tail_uuid': oldcol.portable_data_hash(),
+ 'head_uuid': newcol.portable_data_hash()
+ }}).execute(num_retries=3)
+
+ logger.info("Migrated '%s' to '%s'", oldcol.portable_data_hash(), newcol.portable_data_hash())
+ already_migrated.add(oldcol.portable_data_hash())
+ success.append(old_image["collection"])
+ else:
+ logger.error("Error migrating '%s'", old_image["collection"])
+ failures.append(old_image["collection"])