X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3e0836a454bde7c61192700b5ba96a319e5fafe5..7d7b9f9fe3dadcccffd76493f45a144d21c754ef:/sdk/cwl/arvados_cwl/done.py diff --git a/sdk/cwl/arvados_cwl/done.py b/sdk/cwl/arvados_cwl/done.py index eeef4bce39..e12fe185a0 100644 --- a/sdk/cwl/arvados_cwl/done.py +++ b/sdk/cwl/arvados_cwl/done.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -from future.utils import listvalues +from future.utils import viewvalues import re from cwltool.errors import WorkflowException @@ -52,7 +52,7 @@ def done(self, record, tmpdir, outdir, keepdir): def done_outputs(self, record, tmpdir, outdir, keepdir): self.builder.outdir = outdir self.builder.pathmapper.keepdir = keepdir - return self.collect_outputs("keep:" + record["output"]) + return self.collect_outputs("keep:" + record["output"], record["exit_code"]) crunchstat_re = re.compile(r"^\d{4}-\d\d-\d\d_\d\d:\d\d:\d\d [a-z0-9]{5}-8i9sb-[a-z0-9]{15} \d+ \d+ stderr crunchstat:") timestamp_re = re.compile(r"^(\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d+Z) (.*)") @@ -70,7 +70,7 @@ def logtail(logcollection, logfunc, header, maxlen=25): logname = log[:-4] logt = deque([], maxlen) mergelogs[logname] = logt - with logcollection.open(log) as f: + with logcollection.open(log, encoding="utf-8") as f: for l in f: if containersapi: g = timestamp_re.match(l) @@ -93,7 +93,7 @@ def logtail(logcollection, logfunc, header, maxlen=25): loglines.append("%s %s %s" % (ts, earliest, msg)) loglines = loglines[-maxlen:] else: - loglines = listvalues(mergelogs)[0] + loglines = mergelogs[list(mergelogs)[0]] logtxt = "\n ".join(l.strip() for l in loglines) logfunc("%s\n\n %s", header, logtxt)