diff options
author | Arne Wiebalck <Arne.Wiebalck@cern.ch> | 2021-10-08 08:11:48 +0200 |
---|---|---|
committer | Arne Wiebalck <Arne.Wiebalck@cern.ch> | 2021-10-21 14:12:10 +0200 |
commit | 434a7391293cea8bfdc9faa373187ad102f030f6 (patch) | |
tree | a38a34a473a2348831ac600c85164f1eefae6e91 | |
parent | 60a51252f4a214f39cf2a8eb51e476df0a9c9793 (diff) | |
download | ironic-python-agent-434a7391293cea8bfdc9faa373187ad102f030f6.tar.gz |
Assert EFI part UUID is not None before editing fstab
The EFI partition UUID may be None and this will break
the fstab editing. While this is not necessarily fatal when
instantiating a node, it creates an exception at the end of
bootloader installation, so only attempt to add a line to
fstab when the UUID is not None.
Change-Id: I68799980e67c05afe4ca68ca9733605dd166d54d
(cherry picked from commit 333ed70c94e366f16d8f2633f74a5ef05aa5fadb)
-rw-r--r-- | ironic_python_agent/extensions/image.py | 2 | ||||
-rw-r--r-- | releasenotes/notes/fix_efi_uuid_fstab-f2edbee9bfbac64a.yaml | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py index 018a9374..a39ed353 100644 --- a/ironic_python_agent/extensions/image.py +++ b/ironic_python_agent/extensions/image.py @@ -734,7 +734,7 @@ def _install_grub2(device, root_uuid, efi_system_part_uuid=None, # recommended path. _configure_grub(device, path) - if efi_mounted: + if efi_system_part_uuid and efi_mounted: _append_uefi_to_fstab(path, efi_system_part_uuid) LOG.info("GRUB2 successfully installed on %s", device) diff --git a/releasenotes/notes/fix_efi_uuid_fstab-f2edbee9bfbac64a.yaml b/releasenotes/notes/fix_efi_uuid_fstab-f2edbee9bfbac64a.yaml new file mode 100644 index 00000000..77d64ce0 --- /dev/null +++ b/releasenotes/notes/fix_efi_uuid_fstab-f2edbee9bfbac64a.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue when the EFI partition UUID is not set and an attempt + to edit /etc/fstab is made. + |