Skip to content

Commit 76b017e

Browse files
authored
Merge branch 'master' into unicode_literal_usage
2 parents c191642 + 5b2cd24 commit 76b017e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cwltool/draft2tool.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,17 @@ def job(self,
224224
cmdline = ["docker", "run", dockerimg] + cmdline
225225
keydict = {u"cmdline": cmdline}
226226

227-
for _, f in cachebuilder.pathmapper.items():
227+
for location, f in cachebuilder.pathmapper.items():
228228
if f.type == "File":
229+
checksum = next((e['checksum'] for e in cachebuilder.files
230+
if 'location' in e and e['location'] == location
231+
and 'checksum' in e
232+
and e['checksum'] != 'sha1$hash'), None)
229233
st = os.stat(f.resolved)
230-
keydict[f.resolved] = [st.st_size, int(st.st_mtime * 1000)]
234+
if checksum:
235+
keydict[f.resolved] = [st.st_size, checksum]
236+
else:
237+
keydict[f.resolved] = [st.st_size, int(st.st_mtime * 1000)]
231238

232239
interesting = {"DockerRequirement",
233240
"EnvVarRequirement",

0 commit comments

Comments
 (0)