From 52a49b2f72714e88a49de32fc08e9e99fb691cbf Mon Sep 17 00:00:00 2001 From: Nick Dokos Date: Mon, 26 Jun 2023 12:54:46 -0400 Subject: [PATCH] Address review comments --- agent/util-scripts/pbench-postprocess-tools | 10 +++------- lib/pbench/agent/tool_meister.py | 10 ++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/agent/util-scripts/pbench-postprocess-tools b/agent/util-scripts/pbench-postprocess-tools index 0b84d4ef2f..2c76691212 100755 --- a/agent/util-scripts/pbench-postprocess-tools +++ b/agent/util-scripts/pbench-postprocess-tools @@ -82,14 +82,10 @@ if [[ ! -d "${tool_output_dir}" ]]; then exit 1 fi -# We run `pbench-list-tools', collect the output and parse it +# We run `pbench-list-tools', and parse its output # to determine which host runs which tools with what options. -tmp=${pbench_tmp}/pbench-postprocess-tools.$$ -trap "rm -f ${tmp}" EXIT QUIT INT TERM -pbench-list-tools --group ${group} --with-option >${tmp} 2>/dev/null - let failures=0 -while read hostentry ;do +pbench-list-tools --group ${group} --with-option 2>/dev/null | while read hostentry ;do # Parse an entry from the output of `pbench-list-tools` above. # The format is: "group: ; host: ; tools: , ... IFS=';' read group_spec host_spec tools_spec <<<"${hostentry}" @@ -127,6 +123,6 @@ while read hostentry ;do warn_log "[${script_name}] Missing tool output directory, '${host_tool_output_dir}'" (( failures++ )) fi -done < ${tmp} +done exit ${failures} diff --git a/lib/pbench/agent/tool_meister.py b/lib/pbench/agent/tool_meister.py index 7ef736c40f..572f54ef96 100644 --- a/lib/pbench/agent/tool_meister.py +++ b/lib/pbench/agent/tool_meister.py @@ -303,9 +303,8 @@ def start(self, tool_dir: Path): self.stop_process is None ), f"Tool({self.name}) has an unexpected stop process running" - args = [self.tool_script, "--start", f"--dir={tool_dir}"] + shlex.split( - self.tool_opts - ) + args = [self.tool_script, "--start", f"--dir={tool_dir}"] + args += shlex.split(self.tool_opts) self.logger.info("%s: start_tool -- %s", self.name, " ".join(args)) self.start_process = self._create_process_with_logger(args, tool_dir, "start") self.tool_dir = tool_dir @@ -337,9 +336,8 @@ def stop(self): break time.sleep(0.1) - args = [self.tool_script, "--stop", f"--dir={self.tool_dir}"] + shlex.split( - self.tool_opts - ) + args = [self.tool_script, "--stop", f"--dir={self.tool_dir}"] + args += shlex.split(self.tool_opts) self.logger.info("%s: stop_tool -- %s", self.name, " ".join(args)) self.stop_process = self._create_process_with_logger( args, self.tool_dir, "stop"