From 0689d7b1f3140f46c482fb7495d355de460dcf2d Mon Sep 17 00:00:00 2001 From: meesters Date: Mon, 6 May 2024 10:05:27 +0200 Subject: [PATCH] fix: allowing for accounts containing whitespace --- snakemake_executor_plugin_slurm/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snakemake_executor_plugin_slurm/__init__.py b/snakemake_executor_plugin_slurm/__init__.py index cc0255e..98def4f 100644 --- a/snakemake_executor_plugin_slurm/__init__.py +++ b/snakemake_executor_plugin_slurm/__init__.py @@ -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.") @@ -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(