10088: Updated cwltool deduplicates dependencies to avoid creating separate
[arvados.git] / sdk / cwl / arvados_cwl / runner.py
index 155c6a05039ec65649975d038073185fbc5c4338..bdd80771ff224392516fc216a6e25d0248f3c211 100644 (file)
@@ -69,25 +69,19 @@ def upload_dependencies(arvrunner, name, document_loader,
                   set(("$include", "$schemas", "location")),
                   loadref)
 
-    files = []
-    def visitFiles(path):
-        files.append(path)
-
-    adjustFileObjs(sc, visitFiles)
-    adjustDirObjs(sc, visitFiles)
-
-    normalizeFilesDirs(files)
+    normalizeFilesDirs(sc)
 
     if "id" in workflowobj:
-        files.append({"class": "File", "location": workflowobj["id"]})
+        sc.append({"class": "File", "location": workflowobj["id"]})
 
-    mapper = ArvPathMapper(arvrunner, files, "",
+    mapper = ArvPathMapper(arvrunner, sc, "",
                            "keep:%s",
                            "keep:%s/%s",
                            name=name)
 
     def setloc(p):
-        p["location"] = mapper.mapper(p["location"]).target
+        if not p["location"].startswith("_:"):
+            p["location"] = mapper.mapper(p["location"]).target
     adjustFileObjs(workflowobj, setloc)
     adjustDirObjs(workflowobj, setloc)