[PATCH 2/2] Don't include in the UI disks with protected partitions (#874381).
Chris Lumens
clumens at redhat.com
Mon Dec 3 16:59:29 UTC 2012
We've previously only been excluding protected devices, but we really want
to exclude any device with a protected child on it.
---
pyanaconda/ui/gui/spokes/storage.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index e5bb10b..f43c521 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -90,11 +90,15 @@ class FakeDisk(object):
def description(self):
return "%s %s" % (self.vendor, self.model)
+def hasProtectedPartition(devicetree, disk):
+ return any(map(lambda dep: dep.protected, devicetree.getChildren(disk)))
+
def getDisks(devicetree, fake=False):
if not fake:
devices = devicetree.devices + devicetree._hidden
disks = [d for d in devices if d.isDisk and
not d.format.hidden and
+ not hasProtectedPartition(devicetree, d) and
not (d.protected and
d.removable)]
else:
--
1.7.11.2
More information about the anaconda-patches
mailing list