Skip to content
Snippets Groups Projects
Commit d5039cf7 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'bf/wait' into 'master'

Bf/wait

See merge request fsl/fslpy!210
parents 38411970 61daff3d
No related branches found
No related tags found
No related merge requests found
Pipeline #5121 passed
......@@ -58,7 +58,8 @@ Fixed
* Updated the :func:`.prepareArgs` function to use ``shlex.split`` when
preparing shell command arguments, instead of performing a naive whitespace
split.
* Fixed some bugs in the :func:`.fslsub.info` function.
* Fixed some bugs in the :func:`.fslsub.info` and :func:`.fslinfo.wait`
functions.
2.8.4 (Monday 2nd March 2020)
......
......@@ -160,8 +160,9 @@ def info(job_id):
return {}
res = {}
for line in result.splitlines()[1:]:
key, value = line.split(':', 1)
res[key.strip()] = value.strip()
kv = line.split(':', 1)
if len(kv) == 2:
res[kv[0].strip()] = kv[1].strip()
return res
......@@ -208,7 +209,7 @@ def wait(job_ids):
before continuing
"""
start_time = time.time()
for job_id in _flatten_job_ids(job_ids):
for job_id in _flatten_job_ids(job_ids).split(','):
log.debug('Waiting for job {}'.format(job_id))
while len(info(job_id)) > 0:
wait_time = min(max(1, (time.time() - start_time) / 3.), 20)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment