Merge branch '18947-githttpd'
[arvados.git] / sdk / cwl / arvados_cwl / runner.py
index eae7a77896c702976eb457bbade436a76e4441f5..7d4310b0e0ce94b9430ded7f60ca04416e2964b9 100644 (file)
@@ -353,25 +353,14 @@ def upload_dependencies(arvrunner, name, document_loader,
     if include_primary and "id" in workflowobj:
         sc.append({"class": "File", "location": workflowobj["id"]})
 
-    #if "$schemas" in workflowobj:
-    #    for s in workflowobj["$schemas"]:
-    #        sc.append({"class": "File", "location": s})
-
     def visit_default(obj):
-        #remove = [False]
-        def ensure_default_location(f):
+        def defaults_are_optional(f):
             if "location" not in f and "path" in f:
                 f["location"] = f["path"]
                 del f["path"]
+            normalizeFilesDirs(f)
             optional_deps.append(f)
-            #if "location" in f and not arvrunner.fs_access.exists(f["location"]):
-            #    # Doesn't exist, remove from list of dependencies to upload
-            #    sc[:] = [x for x in sc if x["location"] != f["location"]]
-            #    # Delete "default" from workflowobj
-            #    remove[0] = True
-        visit_class(obj["default"], ("File", "Directory"), ensure_default_location)
-        #if remove[0]:
-        #    del obj["default"]
+        visit_class(obj["default"], ("File", "Directory"), defaults_are_optional)
 
     find_defaults(workflowobj, visit_default)
 
@@ -403,8 +392,6 @@ def upload_dependencies(arvrunner, name, document_loader,
         else:
             del discovered[d]
 
-    print("NN", sc)
-
     mapper = ArvPathMapper(arvrunner, sc, "",
                            "keep:%s",
                            "keep:%s/%s",
@@ -412,8 +399,6 @@ def upload_dependencies(arvrunner, name, document_loader,
                            single_collection=True,
                            optional_deps=optional_deps)
 
-    print("whargh", mapper._pathmap)
-
     def setloc(p):
         loc = p.get("location")
         if loc and (not loc.startswith("_:")) and (not loc.startswith("keep:")):