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
This commit is contained in:
Ilya Etingof 2019-02-15 16:50:17 +01:00
parent 738d4eafdc
commit e95515a075
3 changed files with 13 additions and 13 deletions

View File

@ -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)

View File

@ -230,11 +230,12 @@ image_opts = [
'efficiently. ESP image should contain a '
'FAT12/16/32-formatted file system holding EFI boot '
'loaders (e.g. GRUB2) for each hardware architecture '
'ironic needs to boot. If not configured, ironic '
'will attempt to fetch ESP image from some remote '
'store (if configured) or extract ESP image from '
'UEFI-bootable deploy ISO image.')),
'ironic needs to boot. This option is only used when '
'neither ESP nor ISO deploy image is configured to '
'the node being deployed in which case ironic will '
'attempt to fetch ESP image from the configured '
'location or extract ESP image from UEFI-bootable '
'deploy ISO image.')),
]
img_cache_opts = [

View File

@ -5,7 +5,7 @@ features:
building UEFI-bootable ISO images, in form of a local file or UUID
or URI reference. The new ``[conductor]esp_image`` option can be used
to configure ironic to use local file.
other:
fixes:
- |
Makes ironic building UEFI-only bootable ISO image (when being asked to
build a UEFI-bootable image) rather than building a hybrid