Merge "Support role specific ContainerImagePrepare" into stable/wallaby

This commit is contained in:
Zuul
2023-01-12 17:22:19 +00:00
committed by Gerrit Code Review

View File

@@ -14,6 +14,7 @@
# #
import argparse import argparse
import copy
import os import os
import os.path import os.path
from oslo_config import cfg from oslo_config import cfg
@@ -199,6 +200,25 @@ class DeployOvercloud(command.Command):
params.update(kolla_builder.container_images_prepare_multi( params.update(kolla_builder.container_images_prepare_multi(
env, roles_data, dry_run=True)) env, roles_data, dry_run=True))
for role in roles_data:
# NOTE(tkajinam): If a role-specific container image prepare
# parameter is set, run the image prepare process
# with the overridden environment
role_param = '%sContainerImagePrepare' % role['name']
if env.get('parameter_defaults', {}).get(role_param):
tmp_env = copy.deepcopy(env)
tmp_env['parameter_defaults']['ContainerImagePrepare'] = (
env['parameter_defaults'][role_param]
)
# NOTE(tkajinam): Put the image parameters as role-specific
# parameters
params['%sParameters' % role['name']] = (
kolla_builder.container_images_prepare_multi(
tmp_env, [role], dry_run=True)
)
return params return params
def create_env_files(self, parsed_args, def create_env_files(self, parsed_args,