[PATCH/RHEL6-Branch] RHEL 6.6 Upgrade Fails from AttributeError on Multipath (#1129499)

Robert Marshall rmarshall at redhat.com
Wed Feb 25 15:52:42 UTC 2015


Users reported an unhandled AttributeError NoneType while upgrading
from RHEL6.5 to RHEL6.6. Added a guard against the dev not existing
when looked up by name. NOTE: in both cases the fail was due to the
multipath device not being found - this will skip it but based on
comments on the code it should be ignored anyway and this guard
will ensure it doesn't crash the installer.

Resolves rhbz#1129499
---
 booty/x86.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/booty/x86.py b/booty/x86.py
index 90540c5..8a1c20b 100644
--- a/booty/x86.py
+++ b/booty/x86.py
@@ -48,14 +48,19 @@ class x86BootloaderInfo(efiBootloaderInfo):
         # physical disks ("hda"), and real partitions on physical disks
         # ("hda1"). Anything else gets ignored.
         dev = self.storage.devicetree.getDeviceByName(device)
-        if dev.type == "mdarray":
-            if dev.level != 1:
-                log.error("x86BootloaderInfo.getPhysicalDevices ignoring non "
-                          "level 1 raid array %s" % dev.name)
-                return []
-            devs = dev.parents
+        if dev:
+            devs = [dev]
+            # the above is what we normally want, but if it's mdarray then let's
+            # do something different
+            if hasattr(dev, 'type'):
+                if dev.type == "mdarray":
+                    if dev.level != 1:
+                        log.error("x86BootloaderInfo.getPhysicalDevices ignoring non "
+                                "level 1 raid array %s" % dev.name)
+                        return []
+                    devs = dev.parents
         else:
-            devs = [ dev ]
+            return []
 
         physicalDevices = []
         for dev in devs:
-- 
1.8.3.1



More information about the anaconda-patches mailing list