sunet-fleetlock: also handle ReadTimeout

Turns out this was not caught by ConnectionError.
This commit is contained in:
Patrik Lundin 2024-07-03 14:13:22 +02:00 committed by Mikael Frykholm
parent 84f4325eef
commit f28d0fd60e
Signed by: mifr
GPG key ID: 1467F9D69135C236

View file

@ -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