[PATCH 6/7] Prevent enabling the encryption checkbutton erroneously.

David Lehman dlehman at redhat.com
Wed Dec 5 23:45:33 UTC 2012


The same complicated rules apply when reformat is toggled as when
populating the right side.
---
 pyanaconda/ui/gui/spokes/custom.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index a76444c..000115f 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2234,6 +2234,17 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
 
         encryption_checkbutton = self.builder.get_object("encryptCheckbox")
         encryption_checkbutton.set_sensitive(active)
+        if self._current_selector:
+            device = self._current_selector._device
+            if device.type == "luks/dm-crypt":
+                device = device.slave
+
+            ancestors = device.ancestors
+            ancestors.remove(device)
+            if any([a.format.type == "luks" and a.format.exists for a in ancestors]):
+                # The encryption checkbutton should not be sensitive if there is
+                # existing encryption below the leaf layer.
+                encryption_checkbutton.set_sensitive(False)
 
         fs_combo = self.builder.get_object("fileSystemTypeCombo")
         fs_combo.set_sensitive(active)
-- 
1.7.7.6



More information about the anaconda-patches mailing list