From 213190ae030e9971225ea3f103b4be0a7f2532d4 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Wed, 1 Jun 2022 17:16:22 +0200 Subject: 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 --- kolla/template/methods.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'kolla/template/methods.py') 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(): -- cgit v1.2.3