Skip to content

Commit

Permalink
fix: null byte account guess (#81)
Browse files Browse the repository at this point in the history
attempt to ensure that a '(null)' byte does not overthrow the account
testing.
  • Loading branch information
cmeesters committed Jul 5, 2024
1 parent b5d66fd commit de7251e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion snakemake_executor_plugin_slurm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ def get_account_arg(self, job: JobExecutorInterface):
account = self.get_account()
if account:
self.logger.warning(f"Guessed SLURM account: {account}")
self.test_account(f"{account}")
self._fallback_account_arg = f" -A {account}"
else:
self.logger.warning(
Expand Down Expand Up @@ -456,7 +457,7 @@ def get_account(self):
sacct_out = subprocess.check_output(
cmd, shell=True, text=True, stderr=subprocess.PIPE
)
return sacct_out.strip()
return sacct_out.replace("(null)", "").strip()
except subprocess.CalledProcessError as e:
self.logger.warning(
f"No account was given, not able to get a SLURM account via sacct: "
Expand Down

0 comments on commit de7251e

Please sign in to comment.