Fix SLURM sinfo command parser

This commit is contained in:
Benoît Seignovert 2024-02-20 18:08:46 +01:00
parent e3fda2c317
commit a038d46231
Signed by: Benoît Seignovert
GPG key ID: F5D8895227D18A0B
2 changed files with 3 additions and 4 deletions

View file

@ -140,9 +140,9 @@ def sinfo_run(username: str = None) -> str:
cmd = f'sinfo {flags} --Format={fmt}'
if username:
cmd = f'su - {username} -c "{cmd}"'
cmd = f"su - {username} -c '{cmd}'"
return subprocess.check_output(shlex.split(cmd, posix=False)).decode('utf-8')
return subprocess.check_output(shlex.split(cmd)).decode('utf-8')
def sinfo_reader(result: str) -> list: