Skip to content

Commit

Permalink
Merge pull request #571 from AlmaLinux/issues_562,561,560_yaml_snippets
Browse files Browse the repository at this point in the history
Issues #562,#561,#560:
  • Loading branch information
Stepan Oksanichenko authored Jul 7, 2022
2 parents 1dd0a62 + b813bd5 commit 83aaa3a
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit 83aaa3a

Please sign in to comment.