Fix testing of ibft attribute on device.
Fix for the [bug 1164195](https://bugzilla.redhat.com/show_bug.cgi?id=1164195) was pushed already but with an issue. When I used iscsi with ibft I have found that I can't add `/boot` on iscsi drive with `ip=ibft` set.
*Related: rhbz#1164195*
From: Jiri Konecny jkonecny@redhat.com
Fix testing of ibft attribute on device.
Related: rhbz#1164195 --- pyanaconda/bootloader.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py index 2e1f8ec..b2f6264 100644 --- a/pyanaconda/bootloader.py +++ b/pyanaconda/bootloader.py @@ -121,6 +121,11 @@ def _is_on_iscsi(device): return all(isinstance(disk, blivet.devices.iScsiDiskDevice) for disk in device.disks)
+def _is_ibft(device): + """Tells whether a given device is ibft disk or not.""" + + return all(getattr(disk, "ibft", False) for disk in device.disks) + class BootLoaderError(Exception): pass
@@ -584,7 +589,7 @@ def is_valid_stage1_device(self, device, early=False): log.debug("stage1 device cannot be of type %s", device.type) return False
- if _is_on_iscsi(device) and not getattr(device, "ibft", False): + if _is_on_iscsi(device) and not _is_ibft(device): log.debug("stage1 device cannot be on an iSCSI disk") return False
@@ -696,7 +701,7 @@ def is_valid_stage2_device(self, device, linux=True, non_linux=False): if device.protected: valid = False
- if _is_on_iscsi(device) and not getattr(device, "ibft", False): + if _is_on_iscsi(device) and not _is_ibft(device): self.errors.append(_("%s cannot be on an iSCSI disk") % self.stage2_description) valid = False
Added label: rhel7-branch.
anaconda-patches@lists.fedorahosted.org