Skip to content

Commit 42fa25f

Browse files
committed
fix fetch logic
1 parent c7e21b3 commit 42fa25f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

relenv/fetch.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,15 @@ def fetch(version, triplet, python, check_hosts=CHECK_HOSTS):
5151
"""
5252
Fetch the specified python build.
5353
"""
54-
try:
55-
url = f"https://github.com/saltstack/relenv/releases/download/v{version}/{python}-{triplet}.tar.xz"
56-
if not check_url(url, timeout=5):
57-
for host in check_hosts:
58-
url = f"https://{host}/relenv/{version}/build/{python}-{triplet}.tar.xz"
59-
if check_url(url, timeout=5):
60-
break
61-
else:
62-
print(f"Unable to find file on any hosts {' '.join(check_hosts)}")
63-
sys.exit(1)
54+
url = f"https://github.com/saltstack/relenv/releases/download/v{version}/{python}-{triplet}.tar.xz"
55+
if not check_url(url, timeout=5):
56+
for host in check_hosts:
57+
url = f"https://{host}/relenv/{version}/build/{python}-{triplet}.tar.xz"
58+
if check_url(url, timeout=5):
59+
break
60+
else:
61+
print(f"Unable to find file on any hosts {' '.join(check_hosts)}")
62+
sys.exit(1)
6463
builddir = work_dir("build", DATA_DIR)
6564
os.makedirs(builddir, exist_ok=True)
6665
download_url(url, builddir)

0 commit comments

Comments
 (0)