From 4d87fecd163f5e692e6843fc4709c2b66aee0797 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 9 Oct 2025 13:52:36 +0200 Subject: repos: Deduplicate repos.yaml Introduce rpm/deb entry in repos.yaml, create a structure [base_package_type]: [base_distro]: [base_distro-$arch] Allow any of these to be undefined, defaulting to empty dict This allows to deduplicate entries between distros of the same base_package_type (rpm/deb) Sort repos.yaml Change-Id: Ifc351d5d612e6c6cc82be282aed179c656ae252c Signed-off-by: Michal Nasiadka --- kolla/template/methods.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kolla/template/methods.py') diff --git a/kolla/template/methods.py b/kolla/template/methods.py index 53e0da95b..42b7399bb 100644 --- a/kolla/template/methods.py +++ b/kolla/template/methods.py @@ -126,8 +126,9 @@ def handle_repos(context, reponames, mode): commands = '' try: - repo_list = repo_data[base_distro] | \ - repo_data['%s-%s' % (base_distro, base_arch)] + repo_list = repo_data.get(base_package_type, dict()) | \ + repo_data.get(base_distro, dict()) | \ + repo_data.get('%s-%s' % (base_distro, base_arch), dict()) except KeyError: # NOTE(hrw): Fallback to distro list repo_list = repo_data[base_distro] -- cgit v1.2.3