Skip to content

Commit f80da2a

Browse files
committed
omit header in squeue output
1 parent 37f2891 commit f80da2a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

eessi_bot_job_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def get_current_jobs(self):
106106
if username is None:
107107
raise Exception("Unable to find username")
108108

109-
squeue_cmd = "%s --long --user=%s" % (self.poll_command, username)
109+
squeue_cmd = "%s --long --noheader --user=%s" % (self.poll_command, username)
110110
squeue_output, squeue_err, squeue_exitcode = run_cmd(
111111
squeue_cmd,
112112
"get_current_jobs(): squeue command",
@@ -125,9 +125,9 @@ def get_current_jobs(self):
125125
}
126126

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

0 commit comments

Comments
 (0)