Skip to content

Commit

Permalink
Make refresh_schemas handle firewalls that cut the file transfer midw…
Browse files Browse the repository at this point in the history
…ay (#3546)

Co-authored-by: Sverre H. Huseby <sverre.huseby@statnett.no>
  • Loading branch information
sverrehu and sverrehu authored Jun 12, 2023
1 parent a097471 commit 519ecd6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ansiblelint/schemas/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import urllib.request
from collections import defaultdict
from functools import cache
from http.client import HTTPException
from pathlib import Path
from typing import Any
from urllib.request import Request
Expand Down Expand Up @@ -88,7 +89,7 @@ def refresh_schemas(min_age_seconds: int = 3600 * 24) -> int:
# unload possibly loaded schema
if kind in _schema_cache: # pragma: no cover
del _schema_cache[kind]
except (ConnectionError, OSError) as exc:
except (ConnectionError, OSError, HTTPException) as exc:
if (
isinstance(exc, urllib.error.HTTPError)
and getattr(exc, "code", None) == 304
Expand Down

0 comments on commit 519ecd6

Please sign in to comment.