projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
14885: Updates sdk/cwl and services/fuse ciso8601 dependency
[arvados.git]
/
sdk
/
cwl
/
arvados_cwl
/
done.py
diff --git
a/sdk/cwl/arvados_cwl/done.py
b/sdk/cwl/arvados_cwl/done.py
index 25efade2ab21900dd49dc16978fc9daac536efed..9b26ad7064207e8e76e4f819604833ab7b7a1dd7 100644
(file)
--- a/
sdk/cwl/arvados_cwl/done.py
+++ b/
sdk/cwl/arvados_cwl/done.py
@@
-2,6
+2,8
@@
#
# SPDX-License-Identifier: Apache-2.0
#
# SPDX-License-Identifier: Apache-2.0
+from future.utils import viewvalues
+
import re
from cwltool.errors import WorkflowException
from collections import deque
import re
from cwltool.errors import WorkflowException
from collections import deque
@@
-57,14
+59,13
@@
timestamp_re = re.compile(r"^(\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d+Z) (.*)")
def logtail(logcollection, logfunc, header, maxlen=25):
if len(logcollection) == 0:
def logtail(logcollection, logfunc, header, maxlen=25):
if len(logcollection) == 0:
- logfunc(header)
- logfunc(" ** log is empty **")
+ logfunc("%s\n%s", header, " ** log is empty **")
return
containersapi = ("crunch-run.txt" in logcollection)
mergelogs = {}
return
containersapi = ("crunch-run.txt" in logcollection)
mergelogs = {}
- for log in l
ogcollection.keys(
):
+ for log in l
ist(logcollection
):
if not containersapi or log in ("crunch-run.txt", "stdout.txt", "stderr.txt"):
logname = log[:-4]
logt = deque([], maxlen)
if not containersapi or log in ("crunch-run.txt", "stdout.txt", "stderr.txt"):
logname = log[:-4]
logt = deque([], maxlen)
@@
-78,7
+79,7
@@
def logtail(logcollection, logfunc, header, maxlen=25):
logt.append(l)
if containersapi:
logt.append(l)
if containersapi:
- keys =
mergelogs.keys(
)
+ keys =
list(mergelogs
)
loglines = []
while True:
earliest = None
loglines = []
while True:
earliest = None
@@
-92,8
+93,7
@@
def logtail(logcollection, logfunc, header, maxlen=25):
loglines.append("%s %s %s" % (ts, earliest, msg))
loglines = loglines[-maxlen:]
else:
loglines.append("%s %s %s" % (ts, earliest, msg))
loglines = loglines[-maxlen:]
else:
- loglines = mergelogs
.values()[0
]
+ loglines = mergelogs
[list(mergelogs)[0]
]
logtxt = "\n ".join(l.strip() for l in loglines)
logtxt = "\n ".join(l.strip() for l in loglines)
- logfunc(header)
- logfunc("\n %s", logtxt)
+ logfunc("%s\n\n %s", header, logtxt)