10401: Only upload file:// identifiers.
[arvados.git] / sdk / cwl / arvados_cwl / arvcontainer.py
index 20601243b1dee9272bc4cafa2326df0790bc6f53..5c697b37507ac81d583d8c3f721ef2b45d4c747f 100644 (file)
@@ -53,7 +53,7 @@ class ArvadosContainer(object):
 
         dirs = set()
         for f in self.pathmapper.files():
-            pdh, p, tp = self.pathmapper.mapper(f)
+            pdh, p, tp, stg = self.pathmapper.mapper(f)
             if tp == "Directory" and '/' not in pdh:
                 mounts[p] = {
                     "kind": "collection",
@@ -62,15 +62,22 @@ class ArvadosContainer(object):
                 dirs.add(pdh)
 
         for f in self.pathmapper.files():
-            res, p, tp = self.pathmapper.mapper(f)
-            pdh, path = res[5:].split("/", 1)
+            res, p, tp, stg = self.pathmapper.mapper(f)
+            if res.startswith("keep:"):
+                res = res[5:]
+            elif res.startswith("/keep/"):
+                res = res[6:]
+            else:
+                continue
+            sp = res.split("/", 1)
+            pdh = sp[0]
             if pdh not in dirs:
                 mounts[p] = {
                     "kind": "collection",
                     "portable_data_hash": pdh
                 }
-                if path:
-                    mounts[p]["path"] = path
+                if len(sp) == 2:
+                    mounts[p]["path"] = sp[1]
 
         with Perf(metrics, "generatefiles %s" % self.name):
             if self.generatefiles["listing"]: