[PATCH 2/4] Don't raise an exception for failure to scan an ignored disk.

David Lehman dlehman at redhat.com
Fri Jan 9 21:32:31 UTC 2015


The disk will be ignored anyway, so it should not matter if there are
active devices on it since we won't be trying to write to it.

Related: rhbz#1123450
---
 blivet/devicetree.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 41cc42e..2e5850a 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -944,7 +944,8 @@ class DeviceTree(object):
             #  - devices that contain disklabels made by isohybrid
             #
             if (disk.partitionable and not
-                (disk.format.type == "iso9660" or disk.format.hidden)):
+                (disk.format.type == "iso9660" or disk.format.hidden) and
+                (flags.installer_mode and not self._isIgnoredDisk(disk))):
                 raise DeviceTreeError("failed to scan disk %s" % disk.name)
 
             # there's no need to filter partitions on members of multipaths or
@@ -2176,15 +2177,15 @@ class DeviceTree(object):
         if flags.installer_mode:
             self.teardownAll()
 
-    def _hideIgnoredDisks(self):
-        def _is_ignored(disk):
-            return ((self.ignoredDisks and disk.name in self.ignoredDisks) or
-                    (self.exclusiveDisks and
-                     disk.name not in self.exclusiveDisks))
+    def _isIgnoredDisk(self, disk):
+        return ((self.ignoredDisks and disk.name in self.ignoredDisks) or
+                (self.exclusiveDisks and
+                 disk.name not in self.exclusiveDisks))
 
+    def _hideIgnoredDisks(self):
         # hide any subtrees that begin with an ignored disk
         for disk in [d for d in self._devices if d.isDisk]:
-            if _is_ignored(disk):
+            if self._isIgnoredDisk(disk):
                 ignored = True
                 # If the filter allows all members of a fwraid or mpath, the
                 # fwraid or mpath itself is implicitly allowed as well. I don't
-- 
1.9.3



More information about the anaconda-patches mailing list