aboutsummaryrefslogtreecommitdiff
path: root/kolla/template/methods.py
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2026-06-16 06:47:00 +0200
committerMichal Nasiadka <mnasiadka@gmail.com>2026-06-16 12:44:12 +0000
commit4e400b5b25ed0ae052ba33c91b8ed7a787b01304 (patch)
tree97dcedc1d7884ea3d9353f2237c916b622eb18a4 /kolla/template/methods.py
parent4530208a92df98b69a5cd906e23623ee9ddc386f (diff)
downloadkolla-4e400b5b25ed0ae052ba33c91b8ed7a787b01304.tar.gz
kolla-4e400b5b25ed0ae052ba33c91b8ed7a787b01304.zip
repos: Merge user-provided with default repos.yaml
Change-Id: I7513f1ab627aa5137e16777ca6bee600e14a00e9 Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
Diffstat (limited to 'kolla/template/methods.py')
-rw-r--r--kolla/template/methods.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/kolla/template/methods.py b/kolla/template/methods.py
index 42b7399bb..5dbf8da1b 100644
--- a/kolla/template/methods.py
+++ b/kolla/template/methods.py
@@ -108,15 +108,18 @@ def handle_repos(context, reponames, mode):
if not isinstance(reponames, list):
raise TypeError("First argument should be a list of repositories")
+ default_repofile = os.path.dirname(
+ os.path.realpath(__file__)) + '/repos.yaml'
+ with open(default_repofile, 'r') as repos_file:
+ repo_data = yaml.safe_load(repos_file)
+
if context.get('repos_yaml'):
- repofile = context.get('repos_yaml')
- else:
- repofile = os.path.dirname(os.path.realpath(__file__)) + '/repos.yaml'
-
- with open(repofile, 'r') as repos_file:
- repo_data = {}
- for name, params in yaml.safe_load(repos_file).items():
- repo_data[name] = params
+ with open(context.get('repos_yaml'), 'r') as repos_file:
+ for section, repos in yaml.safe_load(repos_file).items():
+ if section in repo_data:
+ repo_data[section].update(repos)
+ else:
+ repo_data[section] = repos
base_package_type = context.get('base_package_type')
base_distro = context.get('base_distro')