Merge branch '17948-test-collection-tool' into main. Closes #17948
[arvados.git] / sdk / cwl / arvados_cwl / arvtool.py
index 89176923519ee4c737d9376032463dee08a80102..13664a8dfb0d57df0477d4c627928b9be17ad8d7 100644 (file)
@@ -19,9 +19,15 @@ def validate_cluster_target(arvrunner, runtimeContext):
     if runtimeContext.project_uuid:
         cluster_target = runtimeContext.submit_runner_cluster or arvrunner.api._rootDesc["uuidPrefix"]
         if not runtimeContext.project_uuid.startswith(cluster_target):
-            raise WorkflowException("Project uuid '%s' must be for target cluster '%s'" % (runtimeContext.project_uuid, cluster_target))
+            raise WorkflowException("Project uuid '%s' should start with id of target cluster '%s'" % (runtimeContext.project_uuid, cluster_target))
+
         try:
-            arvrunner.api.groups().get(uuid=runtimeContext.project_uuid).execute()
+            if runtimeContext.project_uuid[5:12] == '-tpzed-':
+                arvrunner.api.users().get(uuid=runtimeContext.project_uuid).execute()
+            else:
+                proj = arvrunner.api.groups().get(uuid=runtimeContext.project_uuid).execute()
+                if proj["group_class"] != "project":
+                    raise Exception("not a project, group_class is '%s'" % (proj["group_class"]))
         except Exception as e:
             raise WorkflowException("Invalid project uuid '%s': %s" % (runtimeContext.project_uuid, e))