X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ad4da61a6140dc5cb976b4b5b91c72e0be06d20a..0ff7b94edaaaa07932ae757c0a2b7ba3fde026cb:/sdk/cwl/arvados_cwl/pathmapper.py diff --git a/sdk/cwl/arvados_cwl/pathmapper.py b/sdk/cwl/arvados_cwl/pathmapper.py index 24c319cce5..ffdade0f5e 100644 --- a/sdk/cwl/arvados_cwl/pathmapper.py +++ b/sdk/cwl/arvados_cwl/pathmapper.py @@ -52,13 +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") - else: - for l in srcobj["listing"]: - self.visit(l, uploadfiles) + 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)