[blivet:rhel7:master 2/3] Be even more accepting when allow_imperfect_devices is True (#1090009)

mulhern amulhern at redhat.com
Wed Dec 3 19:33:07 UTC 2014

Resolves: rhbz#1090009

Don't stop the array, even if there is a total failure to find the device
in the device tree.

Signed-off-by: mulhern <amulhern at redhat.com>
 blivet/devicetree.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 189a9e7..7130c2f 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -894,14 +894,22 @@ class DeviceTree(object):
         # if we get here, we found all of the slave devices and
         # something must be wrong -- if all of the slaves are in
         # the tree, this device should be as well
+        # One possibility is that the array is degraded, which is likely to
+        # result in insufficient information to look up the array.
         if device is None:
             if name is None:
+                log.warning("failed to obtain correct array name from udev info, synthesizing a (hopefully) meaningful name")
                 name = udev.device_get_name(info)
                 path = "/dev/" + name
                 path = "/dev/md/" + name
-            log.error("failed to scan md array %s", name)
+            if flags.allow_imperfect_devices:
+                log.warning("failed to scan md array %s, but array may still be usable, and imperfect devices are allowed", name)
+                return None
+            log.warning("failed to scan md array %s, deactivating array", name)
             except MDRaidError:

More information about the anaconda-patches mailing list