Skip to content

Commit

Permalink
Check availability of sha256 checksum files.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Mar 6, 2024
1 parent 5489ab1 commit 5907c13
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions schemas/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ def validate_builds(builds):

def check_urls_exist(download_base_url, files):
for file in files:
download_url = f'{download_base_url}{file["filename"]}'
print(f" Checking '{download_url}'...")
request = urllib.request.Request(download_url, method='HEAD')
response = urllib.request.urlopen(request)
assert response.status == 200, f"Expected status code of 200, got {response.status} for '{download_url}'"
for extension in ['', '.sha256']:
download_url = f'{download_base_url}{file["filename"]}{extension}'
print(f" Checking '{download_url}'...")
request = urllib.request.Request(download_url, method='HEAD')
response = urllib.request.urlopen(request)
assert response.status == 200, f"Expected status code of 200, got {response.status} for '{download_url}'"


if __name__ == '__main__':
Expand Down

0 comments on commit 5907c13

Please sign in to comment.