Skip to content

Commit

Permalink
omit header in squeue output
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Oct 4, 2023
1 parent 37f2891 commit f80da2a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eessi_bot_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_current_jobs(self):
if username is None:
raise Exception("Unable to find username")

squeue_cmd = "%s --long --user=%s" % (self.poll_command, username)
squeue_cmd = "%s --long --noheader --user=%s" % (self.poll_command, username)
squeue_output, squeue_err, squeue_exitcode = run_cmd(
squeue_cmd,
"get_current_jobs(): squeue command",
Expand All @@ -125,9 +125,9 @@ def get_current_jobs(self):
}

# get job info, logging any Slurm issues
# Note, the first two lines of the output are skipped ("range(2,...)")
# because they contain header information.
for i in range(2, len(lines)):
# Note, all output lines of squeue are processed because we run it with
# --noheader.
for i in range(0, len(lines)):
job = lines[i].rstrip().split()
if len(job) >= 9:
job_id = job[0]
Expand Down

0 comments on commit f80da2a

Please sign in to comment.