From f22a505652ed12500b1712f40d2f7d9c67544635 Mon Sep 17 00:00:00 2001 From: Noah Moroze Date: Tue, 3 Dec 2024 03:46:21 +0000 Subject: [PATCH] [manuf] Change log file move method in orchestrator shutil.move() is more robust than os.rename(). If the source and destination are on different partitions, os.rename() throws "OSError: [Errno 18] Invalid cross-device link". Signed-off-by: Noah Moroze --- sw/host/provisioning/orchestrator/src/ot_dut.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sw/host/provisioning/orchestrator/src/ot_dut.py b/sw/host/provisioning/orchestrator/src/ot_dut.py index 69af13da32317..6486596e4d6b7 100644 --- a/sw/host/provisioning/orchestrator/src/ot_dut.py +++ b/sw/host/provisioning/orchestrator/src/ot_dut.py @@ -6,6 +6,7 @@ import logging import os import re +import shutil import tempfile from dataclasses import dataclass @@ -156,8 +157,8 @@ def run_cp(self) -> None: self.device_id.update_base_id(cp_device_id) self._make_log_dir() - os.rename(stdout_logfile, f"{self.log_dir}/cp_out.log.txt") - os.rename(stderr_logfile, f"{self.log_dir}/cp_err.log.txt") + shutil.move(stdout_logfile, f"{self.log_dir}/cp_out.log.txt") + shutil.move(stderr_logfile, f"{self.log_dir}/cp_err.log.txt") self.cp_data = chip_probe_data logging.info(f"CP logs saved to {self.log_dir}.")