[rhel7-branch 1/1] Fix iscsi wasn't allowed /boot with ibft (#1164195)

jkonecny12 installerbot-noreply at redhat.com
Tue Jun 30 12:22:35 UTC 2015


From: Jiri Konecny <jkonecny at 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
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/91dd11c26d7195ad6a82f2dea2ffcd4b62b96f3a


More information about the anaconda-patches mailing list