Skip to content

Commit b6665bf

Browse files
authored
Merge pull request #534 from tesujimath/slurm-oom-reason
Make failure to lookup Slurm reason description non-fatal
2 parents 8aba0d4 + 971149f commit b6665bf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/psij/executors/batch/slurm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ def _get_state(self, state: str) -> JobState:
180180
return SlurmJobExecutor._STATE_MAP[state]
181181

182182
def _get_message(self, reason: str) -> str:
183-
assert reason in SlurmJobExecutor._REASONS_MAP
184-
return SlurmJobExecutor._REASONS_MAP[reason]
183+
return SlurmJobExecutor._REASONS_MAP.get(
184+
reason, f"{reason} - no description available"
185+
)
185186

186187
def job_id_from_submit_output(self, out: str) -> str:
187188
"""See :meth:`~.BatchSchedulerExecutor.job_id_from_submit_output`."""

0 commit comments

Comments
 (0)