Skip to content

Commit

Permalink
fix: allowing for accounts containing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeesters committed May 6, 2024
1 parent 912df83 commit 0689d7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snakemake_executor_plugin_slurm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def get_account_arg(self, job: JobExecutorInterface):
# here, we check whether the given or guessed account is valid
# if not, a WorkflowError is raised
self.test_account(job.resources.slurm_account)
return f" -A {job.resources.slurm_account}"
return f" -A '{job.resources.slurm_account}'"
else:
if self._fallback_account_arg is None:
self.logger.warning("No SLURM account given, trying to guess.")
Expand Down Expand Up @@ -436,7 +436,7 @@ def test_account(self, account):
f"'{account}' with sacctmgr: {e.stderr}"
)

accounts = accounts.split()
accounts = [_.strip() for _ in accounts.split('\n') if len(_)]

if account not in accounts:
raise WorkflowError(
Expand Down

0 comments on commit 0689d7b

Please sign in to comment.