On Fri, 2014-02-21 at 13:19 -0500, mulhern wrote:
Resolves: rhbz#1043763
It is an error for new_devices to be non-empty, but for the swaps and mounts
arguments passed to new_root's Root constructor to be empty.
The added condition is synthesized from the calculation for mounts and swaps
to prevent this happening.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
pyanaconda/ui/gui/spokes/custom.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 61506fc..2a5393e 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -926,11 +926,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# Now it's time to populate the accordion.
# A device scheduled for formatting only belongs in the new root.
- new_devices = [d for d in self._devices if (d.isleaf or
-
d.type.startswith("btrfs"))
- and
- not d.format.exists and
- not d.partitioned]
+ new_devices = [d for d in self._devices if
+ (d.isleaf or d.type.startswith("btrfs")) and
+ ((d.format.mountable and not d.format.mountpoint) or d.format.type ==
"swap") and
+ not d.format.exists and
+ not d.partitioned]
ACK, but I think this comprehension deserves a
comment. Or create
wisely-named lambdas for the first two conditions and call them in the
comprehension with the 'd' passed as an argument.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic