Resolves: rhbz#1060255
The sanity check checks that a LUKS passphrase has been set, so we want to give
the user the opportunity to set that passphrase if the occasion calls for it.
We only prompt them for the passphrase the first time they click Done, not the
second time.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
pyanaconda/ui/gui/spokes/custom.py | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 50da03a..9ce6538 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1975,10 +1975,29 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self.__storage.devicetree.pruneActions()
self.__storage.devicetree.sortActions()
+
# If back has been clicked on once already and no other changes made on the
screen,
# run the storage check now. This handles displaying any errors in the info
bar.
if not self._back_already_clicked:
self._back_already_clicked = True
+
+ new_luks = [d for d in self.__storage.devices
+ if d.format.type == "luks" and not d.format.exists]
+ if new_luks:
+ dialog = PassphraseDialog(self.data)
+ with enlightbox(self.window, dialog.window):
+ rc = dialog.run()
+
+ if rc == 0:
+ # Cancel. Leave the old passphrase set if there was one.
+ return
+
+ self.passphrase = dialog.passphrase
+
+ for luks in new_luks:
+ if not luks.format.hasKey:
+ luks.format.passphrase = self.passphrase
+
if not self._do_check():
return
@@ -1992,20 +2011,6 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# Cancel. Stay on the custom screen.
return
- # Then if they did anything that resulted in new LUKS devices, we need
- # to prompt for passphrases.
- new_luks = any(d for d in self.__storage.devices
- if d.format.type == "luks" and not d.format.exists)
- if new_luks:
- dialog = PassphraseDialog(self.data)
- with enlightbox(self.window, dialog.window):
- rc = dialog.run()
-
- if rc == 0:
- # Cancel. Leave the old passphrase set if there was one.
- return
-
- self.passphrase = dialog.passphrase
NormalSpoke.on_back_clicked(self, button)
--
1.8.3.1