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
parent 01768129f0
commit aa88795ee0
Signed by: patlu
GPG key ID: A0A812BA2249F294

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