change the URL for probing

This commit is contained in:
z4yx 2020-04-05 21:43:56 +08:00
parent 55f9d8f519
commit 4e8488e5f3
2 changed files with 5 additions and 3 deletions

View File

@ -21,5 +21,5 @@ echo "APT finished"
# =================== YUM/DNF repos ==========================
"$yum_sync" "${BASE_URL}/yum/repos/@{os_ver}/" 7 kubernetes x86_64,armhfp,aarch64 "@{comp}-el@{os_ver}-@{arch}" "$YUM_PATH"
"$yum_sync" "${BASE_URL}/yum/repos/@{comp}-el@{os_ver}-@{arch}/" 7 kubernetes x86_64,armhfp,aarch64 "@{comp}-el@{os_ver}-@{arch}" "$YUM_PATH"
echo "YUM finished"

View File

@ -63,9 +63,11 @@ def main():
name = substitute_vars(args.repo_name, vardict)
url = substitute_vars(args.base_url, vardict)
try:
r = requests.head(url, timeout=(7,7))
r = requests.head((url+"/repodata/repomd.xml").replace("//", "/"), timeout=(7,7))
if r.status_code < 400 or r.status_code == 403:
yield (name, url)
else:
print(url, "->", r.status_code)
except:
traceback.print_exc()
@ -92,7 +94,7 @@ enabled=1
if len(dest_dirs) == 0:
print("Nothing to sync")
failed.append((name, arch))
failed.append(('', arch))
continue
cmd_args = ["reposync", "-a", arch, "-c", conf.name, "-d", "-p", str(args.working_dir.absolute()), "-e", cache_dir]