Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ndokos committed Jun 26, 2023
1 parent 3c5b93d commit 52a49b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
10 changes: 3 additions & 7 deletions agent/util-scripts/pbench-postprocess-tools
Original file line number Diff line number Diff line change
Expand Up @@ -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: <group>; host: <host>; tools: <tool> <options, <tool> <options>, ...
IFS=';' read group_spec host_spec tools_spec <<<"${hostentry}"
Expand Down Expand Up @@ -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}
10 changes: 4 additions & 6 deletions lib/pbench/agent/tool_meister.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 52a49b2

Please sign in to comment.