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