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

BF: fixes to info function

parent 54d0e61d
No related branches found
No related tags found
No related merge requests found
...@@ -40,8 +40,7 @@ Example usage, building a short pipeline:: ...@@ -40,8 +40,7 @@ Example usage, building a short pipeline::
""" """
from six import string_types, BytesIO from six import BytesIO
import subprocess as sp
import os.path as op import os.path as op
import glob import glob
import time import time
...@@ -149,8 +148,9 @@ def info(job_id): ...@@ -149,8 +148,9 @@ def info(job_id):
:return: dictionary with information on the submitted job (empty :return: dictionary with information on the submitted job (empty
if job does not exist) if job does not exist)
""" """
from fsl.utils.run import run
try: try:
result = sp.call(['qstat', '-j', job_id]).decode('utf-8') result = run(['qstat', '-j', job_id])
except FileNotFoundError: except FileNotFoundError:
log.debug("qstat not found; assuming not on cluster") log.debug("qstat not found; assuming not on cluster")
return {} return {}
...@@ -158,7 +158,7 @@ def info(job_id): ...@@ -158,7 +158,7 @@ def info(job_id):
return {} return {}
res = {} res = {}
for line in result.splitlines()[1:]: for line in result.splitlines()[1:]:
key, value = line.split(':', nsplit=1) key, value = line.split(':', 1)
res[key.strip()] = value.strip() res[key.strip()] = value.strip()
return res return res
......
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