diff --git a/utils.py b/utils.py index c5d277d2..7e9661a5 100644 --- a/utils.py +++ b/utils.py @@ -39,6 +39,82 @@ WHITELIST_MIRRORS = ( 'repo.almalinux.org', ) +# FIXME: Temporary solution +# https://github.com/AlmaLinux/mirrors/issues/572 +WHITELIST_MIRRORS_PER_ARCH_REPO = { + 'eastus.azure.repo.almalinux.org': { + 'arches': [ + 'x86_64', + 'aarch64', + ], + 'repos': [ + 'AppStream', + 'BaseOS', + 'HighAvailability', + 'NFV', + 'PowerTools', + 'RT', + 'ResilientStorage', + 'devel', + 'extras', + 'plus', + ] + }, + 'germanywestcentral.azure.repo.almalinux.org': { + 'arches': [ + 'x86_64', + 'aarch64', + ], + 'repos': [ + 'AppStream', + 'BaseOS', + 'HighAvailability', + 'NFV', + 'PowerTools', + 'RT', + 'ResilientStorage', + 'devel', + 'extras', + 'plus', + ] + }, + 'southeastasia.azure.repo.almalinux.org': { + 'arches': [ + 'x86_64', + 'aarch64', + ], + 'repos': [ + 'AppStream', + 'BaseOS', + 'HighAvailability', + 'NFV', + 'PowerTools', + 'RT', + 'ResilientStorage', + 'devel', + 'extras', + 'plus', + ] + }, + 'westus2.azure.repo.almalinux.org': { + 'arches': [ + 'x86_64', + 'aarch64', + ], + 'repos': [ + 'AppStream', + 'BaseOS', + 'HighAvailability', + 'NFV', + 'PowerTools', + 'RT', + 'ResilientStorage', + 'devel', + 'extras', + 'plus', + ] + }, +} NUMBER_OF_PROCESSES_FOR_MIRRORS_CHECK = 15 AIOHTTP_TIMEOUT = 30 @@ -379,6 +455,9 @@ async def mirror_available( if version in main_config.duplicated_versions: continue for repo_data in main_config.repos: + if mirror_info.name in WHITELIST_MIRRORS_PER_ARCH_REPO and \ + repo_data.name not in WHITELIST_MIRRORS_PER_ARCH_REPO[mirror_info.name]['repos']: + continue if repo_data.vault: continue arches = _get_arches_for_version( @@ -389,6 +468,9 @@ async def mirror_available( if repo_versions and version not in repo_versions: continue for arch in arches: + if mirror_info.name in WHITELIST_MIRRORS_PER_ARCH_REPO and \ + arch not in WHITELIST_MIRRORS_PER_ARCH_REPO[mirror_info.name]['arches']: + continue if not _is_permitted_arch_for_this_version_and_repo( version=version, arch=arch,