From abbb81cfd0abf432d5b3499c735c6635854e08a0 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Wed, 26 Jul 2017 16:08:37 -0400 Subject: [PATCH 1/3] Pass through 'resolver' when loading workflow steps. --- cwltool/workflow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cwltool/workflow.py b/cwltool/workflow.py index 56bd49f13..4bd926b70 100644 --- a/cwltool/workflow.py +++ b/cwltool/workflow.py @@ -673,7 +673,8 @@ def __init__(self, toolpath_object, pos, **kwargs): toolpath_object["run"], kwargs.get("makeTool"), kwargs, enable_dev=kwargs.get("enable_dev"), strict=kwargs.get("strict"), - fetcher_constructor=kwargs.get("fetcher_constructor")) + fetcher_constructor=kwargs.get("fetcher_constructor"), + resolver=kwargs.get("resolver")) except validate.ValidationException as v: raise WorkflowException( u"Tool definition %s failed validation:\n%s" % From 8e34863348a76f85bd89bff9214aa2d7e9ba4e44 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Wed, 26 Jul 2017 16:28:45 -0400 Subject: [PATCH 2/3] Don't try to update entries that are not in pathmap. --- cwltool/draft2tool.py | 2 +- cwltool/pathmapper.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cwltool/draft2tool.py b/cwltool/draft2tool.py index 6a719b775..747c3a19e 100644 --- a/cwltool/draft2tool.py +++ b/cwltool/draft2tool.py @@ -207,7 +207,7 @@ def makePathMapper(self, reffiles, stagedir, **kwargs): def updatePathmap(self, outdir, pathmap, fn): # type: (Text, PathMapper, Dict) -> None - if "location" in fn: + if "location" in fn and fn["location"] in pathmap: pathmap.update(fn["location"], pathmap.mapper(fn["location"]).resolved, os.path.join(outdir, fn["basename"]), ("Writable" if fn.get("writable") else "") + fn["class"], False) diff --git a/cwltool/pathmapper.py b/cwltool/pathmapper.py index b89a6bad5..6802a91eb 100644 --- a/cwltool/pathmapper.py +++ b/cwltool/pathmapper.py @@ -252,3 +252,6 @@ def reversemap(self, target): # type: (Text) -> Tuple[Text, Text] def update(self, key, resolved, target, type, stage): # type: (Text, Text, Text, Text, bool) -> None self._pathmap[key] = MapperEnt(resolved, target, type, stage) + + def __contains__(self, key): + return key in self._pathmap From ce9812c1f3f6ee0d61e2949b13ee71beb7523988 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Wed, 26 Jul 2017 16:59:04 -0400 Subject: [PATCH 3/3] Use self.realpath() so subclasses work as expected. --- cwltool/stdfsaccess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cwltool/stdfsaccess.py b/cwltool/stdfsaccess.py index 2054ae403..df5056b04 100644 --- a/cwltool/stdfsaccess.py +++ b/cwltool/stdfsaccess.py @@ -67,4 +67,4 @@ def docker_compatible_realpath(self, path): # type: (Text) -> Text if path.startswith('/'): return path return '/'+path - return os.path.realpath(path) + return self.realpath(path)