10081: Rename cwl.input.json to cwl.input.yml, fix test.
[arvados.git] / sdk / cwl / arvados_cwl / pathmapper.py
index e17264bcdd90d48f5972260bd49d6c76459e1cca..ffdade0f5ecbc1562e67dfacdf090c77e7fa24c2 100644 (file)
@@ -52,12 +52,14 @@ class ArvPathMapper(PathMapper):
         elif srcobj["class"] == "Directory":
             if isinstance(src, basestring) and ArvPathMapper.pdh_dirpath.match(src):
                 self._pathmap[src] = MapperEnt(src, self.collection_pattern % src[5:], "Directory")
-            for l in srcobj["listing"]:
+            for l in srcobj.get("listing", []):
                 self.visit(l, uploadfiles)
 
     def addentry(self, obj, c, path, subdirs):
         if obj["location"] in self._pathmap:
             src, srcpath = self.arvrunner.fs_access.get_collection(self._pathmap[obj["location"]].resolved)
+            if srcpath == "":
+                srcpath = "."
             c.copy(srcpath, path + "/" + obj["basename"], source_collection=src, overwrite=True)
             for l in obj.get("secondaryFiles", []):
                 self.addentry(l, c, path, subdirs)