From aa88795ee09e1fb0ffd1b0ffee948e1ad4f33dd9 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Wed, 3 Jul 2024 14:13:22 +0200 Subject: [PATCH] sunet-fleetlock: also handle ReadTimeout Turns out this was not caught by ConnectionError. --- global/overlay/usr/local/bin/sunet-fleetlock | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/global/overlay/usr/local/bin/sunet-fleetlock b/global/overlay/usr/local/bin/sunet-fleetlock index 6f0b557..64effec 100755 --- a/global/overlay/usr/local/bin/sunet-fleetlock +++ b/global/overlay/usr/local/bin/sunet-fleetlock @@ -97,7 +97,10 @@ def do_fleetlock_request( timeout=args.request_timeout, auth=("", config[args.lock_group]["password"]), ) - except requests.exceptions.ConnectionError as e: + except ( + requests.exceptions.ConnectionError, + requests.exceptions.ReadTimeout, + ) as e: print(f"POST request failed: {e}") time.sleep(retry_sleep_delay) continue