X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/9828e9218084856240fdeafa2d388d8bf322e655..09cbdc3074b3f1e69c9c537875146f6da0a6ed8f:/sdk/cwl/arvados_cwl/pathmapper.py diff --git a/sdk/cwl/arvados_cwl/pathmapper.py b/sdk/cwl/arvados_cwl/pathmapper.py index 64fdfa0d04..e2e287bf1d 100644 --- a/sdk/cwl/arvados_cwl/pathmapper.py +++ b/sdk/cwl/arvados_cwl/pathmapper.py @@ -105,9 +105,15 @@ class ArvPathMapper(PathMapper): raise WorkflowException("Directory literal '%s' is missing `listing`" % src) elif src.startswith("http:") or src.startswith("https:"): try: - keepref = http_to_keep(self.arvrunner.api, self.arvrunner.project_uuid, src) - logger.info("%s is %s", src, keepref) - self._pathmap[src] = MapperEnt(keepref, keepref, srcobj["class"], True) + if self.arvrunner.defer_downloads: + # passthrough, we'll download it later. + self._pathmap[src] = MapperEnt(src, src, srcobj["class"], True) + else: + keepref = http_to_keep(self.arvrunner.api, self.arvrunner.project_uuid, src, + varying_url_params=self.arvrunner.toplevel_runtimeContext.varying_url_params, + prefer_cached_downloads=self.arvrunner.toplevel_runtimeContext.prefer_cached_downloads) + logger.info("%s is %s", src, keepref) + self._pathmap[src] = MapperEnt(keepref, keepref, srcobj["class"], True) except Exception as e: logger.warning(str(e)) else: @@ -156,6 +162,9 @@ class ArvPathMapper(PathMapper): if loc.startswith("_:"): return True + if self.arvrunner.defer_downloads and (loc.startswith("http:") or loc.startswith("https:")): + return False + i = loc.rfind("/") if i > -1: loc_prefix = loc[:i+1]