From 2b46a4e8c4435f6947c18c012a0ea9ce96c4ac67 Mon Sep 17 00:00:00 2001 From: Katarzyna Treder Date: Mon, 15 Jul 2024 13:15:15 +0200 Subject: [PATCH] Improve rsync timeout handling Signed-off-by: Katarzyna Treder --- connection/ssh_executor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/connection/ssh_executor.py b/connection/ssh_executor.py index c99c67d..dcd2aec 100644 --- a/connection/ssh_executor.py +++ b/connection/ssh_executor.py @@ -152,10 +152,10 @@ def _rsync( stderr=subprocess.PIPE, timeout=timeout.total_seconds(), ) - except Exception as e: - TestRun.LOGGER.exception( - f"Exception occurred during rsync process. " - f"Please check your SSH key-based authentication.\n{e}" + except subprocess.TimeoutExpired as e: + raise TimeoutError( + f"Timeout exception occurred during rsync process. " + f"Please check whether copying big file did not reach command timeout.\n{e}" ) if completed_process.returncode: