From 7a5f80cec758526c6fff62cfdd511fd6d1ae0ea1 Mon Sep 17 00:00:00 2001 From: Lana Kaleif Date: Thu, 4 May 2023 14:43:31 +0200 Subject: [PATCH] Fix anaconda stage2_id loading from image properties Anaconda stage2 location is not verified nor loaded when kernel and ramdisk instance info on a node is already populated, due to a condition removed by commit 4d653ac225. This change implements a check based on stage2 label presence that again allows stage2 to be processed separately from kernel and ramdisk. And changes incorrect parameter check_on_exit passed to oslo_concurrency.processutils.execute() to the correct one, check_exit_code. Change-Id: If7bfc99f200fd0bfc9fbe2a4c8d039ba6ae8d0c5 --- ironic/common/pxe_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ironic/common/pxe_utils.py b/ironic/common/pxe_utils.py index 371a1b5d52..9da9274b14 100644 --- a/ironic/common/pxe_utils.py +++ b/ironic/common/pxe_utils.py @@ -720,6 +720,7 @@ def get_instance_image_info(task, ipxe_enabled=False): # TODO(TheJulia): Add functionality to look/grab the hints file # for anaconda and just run with the entire path. + if 'stage2' in anaconda_labels: # stage2: installer stage2 squashfs image # ks_template: anaconda kickstart template # ks_cfg - rendered ks_template @@ -1160,7 +1161,7 @@ def validate_kickstart_file(ks_cfg): ks_file.flush() try: utils.execute( - 'ksvalidator', ks_file.name, check_on_exit=[0], attempts=1 + 'ksvalidator', ks_file.name, check_exit_code=[0], attempts=1 ) except processutils.ProcessExecutionError as e: msg = (_("The kickstart file generated does not pass validation. "