If all (block) devices of an MD (FW) RAID container are ignored, the container
itself should be ignored too. Otherwise it is later checked for a number of
(non-ignored) children which is zero and a cryptic/inaccurate warning is shown
to the user (as described in the bug).
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
storage/devicetree.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/storage/devicetree.py b/storage/devicetree.py
index f0733f0..d6f8197 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -41,6 +41,7 @@ import iutil
import platform
import parted
import _ped
+import block
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -946,7 +947,18 @@ class DeviceTree(object):
# the filter ui. Note that making the ui use md names instead is not
# possible as the md names are simpy md# and we cannot predict the #
if udev_device_get_md_level(info) == "container":
- return False
+ if name in self.exclusiveDisks:
+ # XXX: should we do this somewhere above in general?
+ return False
+ # we should ignore the container if all its members are ignored
+ all_rsets = block.getRaidSets()
+ # rsets this device belongs to
+ rsets = []
+ for rs in all_rsets:
+ member_devs = set(member.devpath for member in rs.members if
isinstance(member, block.device.RaidDev))
+ if udev_device_get_name(info) in member_devs:
+ rsets.append(rs)
+ return not any(rs.rs.name in self.exclusiveDisks for rs in rsets)
if udev_device_get_md_container(info) and \
udev_device_get_md_name(info):
--
2.5.0