[PATCH 3/3] Allow implicit inclusion of multipath/fwraid by including all members.

David Lehman dlehman at redhat.com
Fri Sep 6 18:04:09 UTC 2013


Resolves: rhbz#984826
---
 blivet/devicetree.py   | 19 ++++++++++++++++---
 blivet/partitioning.py |  3 ---
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 2930c9d..39e756c 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1921,11 +1921,24 @@ class DeviceTree(object):
 
         self.teardownAll()
 
+        def _is_ignored(disk):
+            return ((self.ignoredDisks and disk.name in self.ignoredDisks) or
+                    (self.exclusiveDisks and
+                     disk.name not in self.exclusiveDisks))
+
         # hide any subtrees that begin with an ignored disk
         for disk in [d for d in self._devices if d.isDisk]:
-            if ((self.ignoredDisks and disk.name in self.ignoredDisks) or
-                (self.exclusiveDisks and disk.name not in self.exclusiveDisks)):
-                self.hide(disk)
+            if _is_ignored(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
+                # like this very much but we have supported this usage in the
+                # past, so I guess we will support it forever.
+                if disk.parents and all(p.format.hidden for p in disk.parents):
+                    ignored = any(_is_ignored(d) for d in disk.parents)
+
+                if ignored:
+                    self.hide(disk)
 
     def teardownAll(self):
         """ Run teardown methods on all devices. """
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index 2a417ef..abaf1b3 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -750,9 +750,6 @@ def doPartitioning(storage):
 
     """
     disks = storage.partitioned
-    if storage.config.exclusiveDisks:
-        disks = [d for d in disks if d.name in storage.config.exclusiveDisks]
-
     for disk in disks:
         try:
             disk.setup()
-- 
1.8.1.4



More information about the anaconda-patches mailing list