[anaconda:rhel7/master] Omit a few more devices from new_devices (#1043763)

mulhern amulhern at redhat.com
Fri Feb 21 18:19:04 UTC 2014


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 at 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]
 
         # If mountpoints have been assigned to any existing devices, go ahead
         # and pull those in along with any existing swap devices. It doesn't
-- 
1.8.3.1



More information about the anaconda-patches mailing list