From eaabd446b8f241d7cec4465727beb1f261671f2a Mon Sep 17 00:00:00 2001 From: Daniel Madej Date: Mon, 18 Nov 2024 14:50:44 +0100 Subject: [PATCH] Fix log gathering For DUTs without IP defined use host when creating log dir (IP set to None caused an exception) Use paramiko method for copying log files (works when running tests from Windows) Signed-off-by: Daniel Madej --- log/logger.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/log/logger.py b/log/logger.py index 257631c..0c82be6 100644 --- a/log/logger.py +++ b/log/logger.py @@ -199,12 +199,13 @@ class Log(HtmlLogManager, metaclass=Singleton): TestRun.executor.run(f"dmesg > {log_files['dmesg.log']}") + dut_identifier = TestRun.dut.ip if TestRun.dut.ip else TestRun.dut.config["host"] for log_name, log_source_path in log_files.items(): try: log_destination_path = os.path.join( - self.base_dir, f"dut_info", TestRun.dut.ip, log_name + self.base_dir, "dut_info", dut_identifier, log_name ) - TestRun.executor.rsync_from(log_source_path, log_destination_path) + TestRun.executor.copy_from(log_source_path, log_destination_path) except Exception as e: TestRun.LOGGER.warning( f"There was a problem during gathering {log_name} log.\n{str(e)}"