mongo/evergreen/jstestshell_sha_check.py
Zack Winter 5c24a13a7d SERVER-111295 Set python as formatter in format_multirun (#41677)
GitOrigin-RevId: fd3c58d1f5a9230a9fb728d2678c8c614c20437f
2025-09-24 17:41:24 +00:00

27 lines
754 B
Python

import argparse
import sys
import requests
from buildscripts.s3_binary.download import download_s3_binary
def url_exists(url, timeout=5):
try:
response = requests.head(url, allow_redirects=True, timeout=timeout)
return response.status_code == 200
except requests.RequestException:
return False
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Download and verify S3 binary.")
parser.add_argument("s3_path", help="S3 URL to download from")
parser.add_argument("local_path", nargs="?", help="Optional output file path")
args = parser.parse_args()
if url_exists(args.s3_path):
if not download_s3_binary(args.s3_path, args.local_path, True):
sys.exit(1)