From adea9cc2a7a9c5da0c3d0c3d3ffce561b910c00f Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Tue, 19 Apr 2022 13:38:12 +0200 Subject: [PATCH] Common: Fix error logging for wait_commands * Add Timer TODO --- monkey/common/cmd/cmd_runner.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/monkey/common/cmd/cmd_runner.py b/monkey/common/cmd/cmd_runner.py index e612f4efb..38d22b0a1 100644 --- a/monkey/common/cmd/cmd_runner.py +++ b/monkey/common/cmd/cmd_runner.py @@ -79,7 +79,7 @@ class CmdRunner(object): curr_time = init_time results = [] - + # TODO: Use timer.Timer while (curr_time - init_time < timeout) and (len(commands) != 0): for command in list( commands @@ -95,9 +95,8 @@ class CmdRunner(object): for command, result in results: if not result.is_success: logger.error( - "The following command failed: `%s`. status code: %s", - str(command[1]), - str(result.status_code), + f"The command with id: {str(command.cmd_id)} failed. " + f"Status code: {str(result.status_code)}" ) return results