Merge "Fix ks_template property to be processed only for anaconda deploy"

This commit is contained in:
Zuul 2023-07-26 17:06:12 +00:00 committed by Gerrit Code Review
commit 40356e2eae

View File

@ -664,11 +664,12 @@ def get_instance_image_info(task, ipxe_enabled=False):
"""
ctx = task.context
node = task.node
boot_option = deploy_utils.get_boot_option(node)
image_info = {}
# NOTE(pas-ha) do not report image kernel and ramdisk for
# local boot or whole disk images so that they are not cached
if (node.driver_internal_info.get('is_whole_disk_image')
or deploy_utils.get_boot_option(node) == 'local'):
or boot_option == 'local'):
return image_info
root_dir = _get_root_dir(ipxe_enabled)
i_info = node.instance_info
@ -697,7 +698,9 @@ def get_instance_image_info(task, ipxe_enabled=False):
# like is done with basically Glance.
labels = ('kernel', 'ramdisk')
if not isap:
if boot_option != 'kickstart':
anaconda_labels = ()
elif not isap:
anaconda_labels = ('stage2', 'ks_template', 'ks_cfg')
else:
# When a path is used, a stage2 ramdisk can be determiend
@ -744,6 +747,8 @@ def get_instance_image_info(task, ipxe_enabled=False):
else:
node.set_driver_internal_info(
'stage2', str(image_properties['stage2_id']))
if 'ks_template' in anaconda_labels:
# NOTE(TheJulia): A kickstart template is entirely independent
# of the stage2 ramdisk. In the end, it was the configuration which
# told anaconda how to execute.