Skip to content

Commit

Permalink
Fixed wrong information was passed to spooler regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jitkang authored Nov 20, 2023
1 parent d66798b commit 328f332
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/slurmmail/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,10 +790,10 @@ def spool_mail_main():
die("Incorrect number of command line arguments")

try:
info = ",".join(sys.argv[2].split(","))
logging.debug("info str: %s", info)
match = None
if "Array" in sys.argv[2]:
info = ",".join(sys.argv[2].split(","))
logging.debug("info str: %s", info)
if "Array" in info:
match = re.search(
r"Slurm ((?P<array_summary>Array Summary)|Array Task)"
r" Job_id=[0-9]+_([0-9]+|\*)"
Expand All @@ -806,8 +806,6 @@ def spool_mail_main():
die("Failed to parse Slurm info.")
array_summary = match.group("array_summary") is not None
else:
info = ",".join(sys.argv[2].split(",")[0:-1])
logging.debug("info str: %s", info)
match = re.search(
r"Slurm"
r" Job_id=(?P<job_id>[0-9]+).*?(?P<state>(Began|Ended|Failed|Requeued|Invalid" # noqa
Expand Down

0 comments on commit 328f332

Please sign in to comment.