Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ htmlcov
docs/_build
.cache/*
.pytest_cache/
.hypothesis/*
**/.hypothesis/*
geckodriver.log
ghostdriver.log
cove/lib/org-ids.json
Expand Down
14 changes: 12 additions & 2 deletions lib360dataquality/cove/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,24 @@ def __init__(self, data_dir, local_pkg_schema_path=None, local_grant_schema_path
self._pkg_schema_obj = json.load(f)
else:
pkg_schema_url = urljoin(config["schema_host"], self.pkg_schema_name)
self._pkg_schema_obj = get_request(pkg_schema_url).json()
try:
self._pkg_schema_obj = get_request(pkg_schema_url, force_cache=True).json()
except json.JSONDecodeError as exc:
raise Exception("Could not parse JSON from package schema") from exc
except Exception as exc:
raise Exception("Could not fetch package schema") from exc

if local_grant_schema_path:
with open(local_grant_schema_path) as f:
self._schema_obj = json.load(f)
else:
schema_url = urljoin(config["schema_host"], self.schema_name)
self._schema_obj = get_request(schema_url).json()
try:
self._schema_obj = get_request(schema_url, force_cache=True).json()
except json.JSONDecodeError as exc:
raise Exception("Could not parse JSON from grant schema") from exc
except Exception as exc:
raise Exception("Could not fetch grant schema") from exc

# Update the pkg schema to no longer point to an external reference for the
# grants schema.
Expand Down
Loading