Skip to content

Commit

Permalink
fix(#60): Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-akim committed Nov 16, 2023
1 parent c6bdecf commit 1ebf890
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/wazuh_qa_framework/system/host_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,9 @@ def stop_ungracefully_process(self, host, process):
"""
try:
if self.is_windows(host):
self.run_command(host, f'taskkill /F /IM {process}')
self.run_command(host, f"taskkill /F /IM {process}")
else:
self.run_command(host, f'pkill -9 {process}')
self.run_command(host, f"pkill -9 {process}")

except Exception as e:
raise Exception(f"An error occurred while stopping the process. {e}")
Expand Down
5 changes: 2 additions & 3 deletions src/wazuh_qa_framework/system/wazuh_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def stop_agent(self, host, gracefully=True):

else:
self.control_service(host, service_name, 'stopped')
self.logger.info(f'Agent {host} stopped {type}')
self.logger.info(f"Agent {host} stopped {type}")

else:
raise ValueError(f"Host {host} is not an agent")
Expand All @@ -721,8 +721,7 @@ def stop_agents(self, agent_list=None, parallel=True, gracefully=True):
gracefully (bool): Stop gracefully. Defaults to True.
"""
if parallel:
stop_agent_with_type = partial(self.stop_agent, gracefully=gracefully)
self.pool.map(stop_agent_with_type, agent_list)
self.pool.starmap(self.stop_agent, [(agent, gracefully) for agent in agent_list])
else:
for agent in agent_list:
self.stop_agent(agent, gracefully)
Expand Down

0 comments on commit 1ebf890

Please sign in to comment.