summaryrefslogtreecommitdiff
path: root/kolla/template
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz+kolla@linaro.org>2022-06-01 17:16:22 +0200
committerMarcin Juszkiewicz <marcin.juszkiewicz+kolla@linaro.org>2022-06-02 11:46:38 +0200
commit213190ae030e9971225ea3f103b4be0a7f2532d4 (patch)
treee803bb72353a63292a0fa21657f8bc1d2c1385f4 /kolla/template
parentd424a63d6049d8d241ab1294aea035d4b187a111 (diff)
downloadkolla-213190ae030e9971225ea3f103b4be0a7f2532d4.tar.gz
kolla-213190ae030e9971225ea3f103b4be0a7f2532d4.zip
Allow to provide own repos.yaml file
Several people use Kolla behind firewall/proxy. Internal mirrors are often in use then. We do not provide a way to replace repos.yaml file in an easy way which may lead to complicated solutions or template overrides. This patch adds a way to provide own copy of repos.yaml file. Change-Id: I0b07da22fea27e0ff4e90aaad19e50d84ff9a121
Diffstat (limited to 'kolla/template')
-rw-r--r--kolla/template/methods.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/kolla/template/methods.py b/kolla/template/methods.py
index 4426512bb..94d72401b 100644
--- a/kolla/template/methods.py
+++ b/kolla/template/methods.py
@@ -91,7 +91,11 @@ def handle_repos(context, reponames, mode):
if not isinstance(reponames, list):
raise TypeError("First argument should be a list of repositories")
- repofile = os.path.dirname(os.path.realpath(__file__)) + '/repos.yaml'
+ 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():