Skip to content

Commit 5656a69

Browse files
authored
Merge pull request #335 from boegel/fix_templated_scontrol_command
don't replace self.scontrol_command in process_new_job
2 parents 6bfb246 + 0fdfed4 commit 5656a69

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

eessi_bot_job_manager.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,23 +305,23 @@ def process_new_job(self, new_job):
305305

306306
# processing placeholders in scontrol command which is defined in the bot's app.cfg (setting `scontrol_command`)
307307
try:
308-
self.scontrol_command = self.scontrol_command % new_job
308+
templated_scontrol_command = self.scontrol_command % new_job
309309
except KeyError:
310310
log(f"Failed to process {self.scontrol_command}.")
311311
log(f"Information on placeholder is not collected in new_job: {new_job}.")
312312
raise
313313

314-
scontrol_cmd = "%s --oneliner show jobid %s" % (
315-
self.scontrol_command,
314+
cmd = "%s --oneliner show jobid %s" % (
315+
templated_scontrol_command,
316316
job_id,
317317
)
318318
scontrol_output, scontrol_err, scontrol_exitcode = run_cmd(
319-
scontrol_cmd,
319+
cmd,
320320
"process_new_job(): scontrol command",
321321
log_file=self.logfile,
322322
)
323323

324-
# parse output of 'scontrol_cmd'
324+
# parse output of scontrol command that fetches job info
325325
job_info = self.parse_scontrol_show_job_output(str(scontrol_output))
326326

327327
# check if job_info contains 'WorkDir', if not we cannot process the job
@@ -366,7 +366,7 @@ def process_new_job(self, new_job):
366366
extra_info = ''
367367
if self.job_handover_protocol == config.JOB_HANDOVER_PROTOCOL_HOLD_RELEASE:
368368
release_cmd = "%s release %s" % (
369-
self.scontrol_command,
369+
templated_scontrol_command,
370370
job_id,
371371
)
372372

0 commit comments

Comments
 (0)