Skip to content

Commit 9db6b79

Browse files
committed
SSHDriver: Fix Timeout handling on start_own_master()
Without this change an Exception during `_start_own_master_once()` could get lost if the timeout happens at the wrong point in time. With this change we re-raise the last exception that happened during `_start_own_master_once()`. Signed-off-by: Chris Fiege <[email protected]>
1 parent b8babc1 commit 9db6b79

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

labgrid/driver/sshdriver.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,11 @@ def _start_own_master(self):
9797
# connection refused during target startup
9898
connect_timeout = round(timeout.remaining)
9999
while True:
100-
if connect_timeout == 0:
101-
raise Exception("Timeout while waiting for ssh connection")
102100
try:
103101
return self._start_own_master_once(connect_timeout)
104102
except ExecutionError as e:
105103
if timeout.expired:
106-
raise e
104+
raise Exception("Timeout while waiting for ssh connection") from e
107105
time.sleep(0.5)
108106
connect_timeout = round(timeout.remaining)
109107

0 commit comments

Comments
 (0)