diff --git a/iperf/iperf_functions.py b/iperf/iperf_functions.py index d15a368..92f4afd 100644 --- a/iperf/iperf_functions.py +++ b/iperf/iperf_functions.py @@ -91,10 +91,12 @@ def collect_iperf( if result.returncode != 0: print(f"Error running iperf3: {result.stderr}") output = "" + error = result.stderr except subprocess.TimeoutExpired: print(f"iPerf test timed out after {timeout} seconds.") output = "" + error = f"iPerf test timed out after {timeout} seconds." sender_bitrate, receiver_bitrate = parse_iperf_output(output) @@ -113,7 +115,7 @@ def collect_iperf( "stations": stations, } if output == "": - data["error"] = f"Test exceeded timeout of {timeout}s" + data["error"] = error else: print(f"\n{server_ip} {test_type} IPERF complete") print(f"IPERF sender bitrate: {sender_bitrate}")