Skip to content

Commit

Permalink
Issues #562,#561,#560:
Browse files Browse the repository at this point in the history
- No source of entropy in _get_nearest_mirrors_by_network_data()
- _get_nearest_mirrors_by_network_data() fails to exclude near-by private mirrors for extra options.
- Exclude the private mirrors from the mirrors list in the case of fallback behavior

The Azure mirrors have allowed list of arches
  • Loading branch information
soksanichenko committed Jul 1, 2022
1 parent 1dd0a62 commit 1f9f85f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@
WHITELIST_MIRRORS = (
'repo.almalinux.org',
)
WHITELIST_MIRRORS_PER_ARCH = {
'eastus.azure.repo.almalinux.org': [
'x86_64',
'aarch64',
],
'germanywestcentral.azure.repo.almalinux.org': [
'x86_64',
'aarch64',
],
'southeastasia.azure.repo.almalinux.org': [
'x86_64',
'aarch64',
],
'westus2.azure.repo.almalinux.org': [
'x86_64',
'aarch64',
],
}
NUMBER_OF_PROCESSES_FOR_MIRRORS_CHECK = 15
AIOHTTP_TIMEOUT = 30

Expand Down Expand Up @@ -389,6 +407,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 and \
arch not in WHITELIST_MIRRORS_PER_ARCH[mirror_info.name]:
continue
if not _is_permitted_arch_for_this_version_and_repo(
version=version,
arch=arch,
Expand Down

0 comments on commit 1f9f85f

Please sign in to comment.