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

David Lehman dlehman at redhat.com
Tue Jan 20 19:53:59 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 | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 41cc42e..ea82645 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -943,8 +943,10 @@ class DeviceTree(object):
             #  - devices that do not have a usable disklabel
             #  - devices that contain disklabels made by isohybrid
             #
-            if (disk.partitionable and not
-                (disk.format.type == "iso9660" or disk.format.hidden)):
+            if disk.partitionable and \
+               disk.format.type != "iso9660" and \
+               not disk.format.hidden 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 +2178,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