Skip to content

Commit 096b89a

Browse files
authored
Pass through 'resolver' when loading workflow steps. (#498)
* Pass through 'resolver' when loading workflow steps. * Don't try to update entries that are not in pathmap. * Use self.realpath() so subclasses work as expected.
1 parent da4930f commit 096b89a

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

cwltool/draft2tool.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def makePathMapper(self, reffiles, stagedir, **kwargs):
220220

221221
def updatePathmap(self, outdir, pathmap, fn):
222222
# type: (Text, PathMapper, Dict) -> None
223-
if "location" in fn:
223+
if "location" in fn and fn["location"] in pathmap:
224224
pathmap.update(fn["location"], pathmap.mapper(fn["location"]).resolved,
225225
os.path.join(outdir, fn["basename"]),
226226
("Writable" if fn.get("writable") else "") + fn["class"], False)

cwltool/pathmapper.py

+3
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,6 @@ def reversemap(self, target): # type: (Text) -> Tuple[Text, Text]
252252

253253
def update(self, key, resolved, target, type, stage): # type: (Text, Text, Text, Text, bool) -> None
254254
self._pathmap[key] = MapperEnt(resolved, target, type, stage)
255+
256+
def __contains__(self, key):
257+
return key in self._pathmap

cwltool/stdfsaccess.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ def docker_compatible_realpath(self, path): # type: (Text) -> Text
6767
if path.startswith('/'):
6868
return path
6969
return '/'+path
70-
return os.path.realpath(path)
70+
return self.realpath(path)

cwltool/workflow.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,8 @@ def __init__(self, toolpath_object, pos, **kwargs):
673673
toolpath_object["run"], kwargs.get("makeTool"), kwargs,
674674
enable_dev=kwargs.get("enable_dev"),
675675
strict=kwargs.get("strict"),
676-
fetcher_constructor=kwargs.get("fetcher_constructor"))
676+
fetcher_constructor=kwargs.get("fetcher_constructor"),
677+
resolver=kwargs.get("resolver"))
677678
except validate.ValidationException as v:
678679
raise WorkflowException(
679680
u"Tool definition %s failed validation:\n%s" %

0 commit comments

Comments
 (0)