diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7a4ecf4ebe1af6e37ce337f7a822f842c5da2c96..a9102c536d131052e048e8ca04a498659cfcdcbb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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) diff --git a/fsl/utils/fslsub.py b/fsl/utils/fslsub.py index 9e7eb039de04ef50d267f464f41e3b010c13eb57..4f8479c716de3454cc7d26f850e81d4872de76da 100644 --- a/fsl/utils/fslsub.py +++ b/fsl/utils/fslsub.py @@ -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)