diff options
| author | Marcin Juszkiewicz <marcin.juszkiewicz+kolla@linaro.org> | 2022-06-01 17:16:22 +0200 |
|---|---|---|
| committer | Marcin Juszkiewicz <marcin.juszkiewicz+kolla@linaro.org> | 2022-06-02 11:46:38 +0200 |
| commit | 213190ae030e9971225ea3f103b4be0a7f2532d4 (patch) | |
| tree | e803bb72353a63292a0fa21657f8bc1d2c1385f4 /kolla/template | |
| parent | d424a63d6049d8d241ab1294aea035d4b187a111 (diff) | |
| download | kolla-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.py | 6 |
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(): |
