From fc3c23dc8a08bf5780cc6faa6a39f3993324a5e2 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 20 Aug 2025 14:25:13 +0200 Subject: [PATCH 1/2] don't replace self.scontrol_command in process_new_job, to keep placeholder and allow processing jobs that require different placeholder values --- eessi_bot_job_manager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eessi_bot_job_manager.py b/eessi_bot_job_manager.py index d0423923..238174c0 100644 --- a/eessi_bot_job_manager.py +++ b/eessi_bot_job_manager.py @@ -305,18 +305,18 @@ def process_new_job(self, new_job): # processing placeholders in scontrol command which is defined in the bot's app.cfg (setting `scontrol_command`) try: - self.scontrol_command = self.scontrol_command % new_job + templated_scontrol_command = self.scontrol_command % new_job except KeyError: log(f"Failed to process {self.scontrol_command}.") log(f"Information on placeholder is not collected in new_job: {new_job}.") raise - scontrol_cmd = "%s --oneliner show jobid %s" % ( - self.scontrol_command, + cmd = "%s --oneliner show jobid %s" % ( + templated_scontrol_command, job_id, ) scontrol_output, scontrol_err, scontrol_exitcode = run_cmd( - scontrol_cmd, + cmd, "process_new_job(): scontrol command", log_file=self.logfile, ) @@ -366,7 +366,7 @@ def process_new_job(self, new_job): extra_info = '' if self.job_handover_protocol == config.JOB_HANDOVER_PROTOCOL_HOLD_RELEASE: release_cmd = "%s release %s" % ( - self.scontrol_command, + templated_scontrol_command, job_id, ) From 0fdfed4efe9b020d3e8faf3b8c1437aad0d3518e Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 20 Aug 2025 14:29:52 +0200 Subject: [PATCH 2/2] fix comment --- eessi_bot_job_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eessi_bot_job_manager.py b/eessi_bot_job_manager.py index 238174c0..fd67b913 100644 --- a/eessi_bot_job_manager.py +++ b/eessi_bot_job_manager.py @@ -321,7 +321,7 @@ def process_new_job(self, new_job): log_file=self.logfile, ) - # parse output of 'scontrol_cmd' + # parse output of scontrol command that fetches job info job_info = self.parse_scontrol_show_job_output(str(scontrol_output)) # check if job_info contains 'WorkDir', if not we cannot process the job