diff options
Diffstat (limited to 'kolla')
| -rw-r--r-- | kolla/common/config.py | 2 | ||||
| -rw-r--r-- | kolla/template/methods.py | 19 |
2 files changed, 12 insertions, 9 deletions
diff --git a/kolla/common/config.py b/kolla/common/config.py index c4ebcbf3b..0d6e70aa6 100644 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -256,7 +256,7 @@ _CLI_OPTS = [ cfg.StrOpt('image-name-prefix', default='', help='Prefix prepended to image names'), cfg.StrOpt('repos-yaml', default='', - help='Path to alternative repos.yaml file'), + help='Path to repos.yaml override file'), cfg.StrOpt('engine', default='docker', choices=['docker', 'podman'], help='Container engine to build images on.'), cfg.StrOpt('podman_base_url', default='unix:///run/podman/podman.sock', 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') |
