diff options
author | Ilya Etingof <etingof@gmail.com> | 2019-02-15 16:50:17 +0100 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2019-02-15 16:50:17 +0100 |
commit | e95515a07557fccc6badd85bc36b9bd9ed411211 (patch) | |
tree | c4329c19781c48d772b6a2bb62b9cbca439b2c9d /ironic/common/images.py | |
parent | 738d4eafdc371220b59a48cab9b981e7c3da86cf (diff) | |
download | ironic-e95515a07557fccc6badd85bc36b9bd9ed411211.tar.gz |
Follow up to ISO image build patch
This change addresses a few nits pointed out in the Gerrit
review (Change-Id: Idf912ff2146434b666fdb4250dc1ecad39bc5a04).
Change-Id: I8668b02a2f46427567526189caa2040fc1e3b402
Story: 1526753
Task: 28098
Diffstat (limited to 'ironic/common/images.py')
-rw-r--r-- | ironic/common/images.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ironic/common/images.py b/ironic/common/images.py index b68911e93..833d76f66 100644 --- a/ironic/common/images.py +++ b/ironic/common/images.py @@ -261,18 +261,16 @@ def create_isolinux_image_for_uefi(output_file, kernel, ramdisk, # Open the deploy iso used to initiate deploy and copy the # efiboot.img i.e. boot loader to the current temporary # directory. - if deploy_iso: + if deploy_iso and not esp_image: uefi_path_info, e_img_rel_path, grub_rel_path = ( _mount_deploy_iso(deploy_iso, mountdir)) grub_cfg = os.path.join(tmpdir, grub_rel_path) # Use ELF boot loader provided - elif esp_image: + elif esp_image and not deploy_iso: e_img_rel_path = EFIBOOT_LOCATION - grub_rel_path = CONF.grub_config_path.strip() - while grub_rel_path.startswith(os.sep): - grub_rel_path = grub_rel_path[1:] + grub_rel_path = CONF.grub_config_path.lstrip(' ' + os.sep) grub_cfg = os.path.join(tmpdir, grub_rel_path) uefi_path_info = { @@ -281,9 +279,10 @@ def create_isolinux_image_for_uefi(output_file, kernel, ramdisk, } else: + msg = _('Neither deploy ISO nor ESP image configured or ' + 'both of them configured') raise exception.ImageCreationFailed( - image_type='iso', - error='Neither `deploy_iso` nor `esp_image` configured') + image_type='iso', error=msg) files_info.update(uefi_path_info) |