summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iw/lvm_dialog_gui.py3
-rw-r--r--iw/partition_dialog_gui.py9
-rw-r--r--iw/raid_dialog_gui.py4
3 files changed, 12 insertions, 4 deletions
diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
index 18e140a8e..e22665053 100644
--- a/iw/lvm_dialog_gui.py
+++ b/iw/lvm_dialog_gui.py
@@ -691,7 +691,8 @@ class VolumeGroupEditor:
format = fmt_class(mountpoint=mountpoint)
if self.lukscb and self.lukscb.get_active() and \
- templv.format.type != "luks":
+ (templv.format.type != "luks" or
+ (templv.format.exists and not templv.format.hasKey)):
newluks = format
format = getFormat("luks",
passphrase=self.storage.encryptionPassphrase)
diff --git a/iw/partition_dialog_gui.py b/iw/partition_dialog_gui.py
index e19b229e2..5980efc5e 100644
--- a/iw/partition_dialog_gui.py
+++ b/iw/partition_dialog_gui.py
@@ -215,7 +215,10 @@ class PartitionEditor:
# preexisting partition
request = self.origrequest
if request.format.type == "luks":
- usedev = self.storage.devicetree.getChildren(request)[0]
+ try:
+ usedev = self.storage.devicetree.getChildren(request)[0]
+ except IndexError:
+ usedev = request
else:
usedev = request
@@ -235,7 +238,9 @@ class PartitionEditor:
luksdev = None
if self.fsoptionsDict.has_key("lukscb") and \
self.fsoptionsDict["lukscb"].get_active() and \
- request.format.type != "luks":
+ (request.format.type != "luks" or
+ (request.format.exists and
+ not request.format.hasKey)):
luksdev = LUKSDevice("luks%d" % self.storage.nextID,
format=format,
parents=request)
diff --git a/iw/raid_dialog_gui.py b/iw/raid_dialog_gui.py
index 863400ed4..02a452ea9 100644
--- a/iw/raid_dialog_gui.py
+++ b/iw/raid_dialog_gui.py
@@ -234,7 +234,9 @@ class RaidEditor:
format = fmt_class(mountpoint=mountpoint)
if self.fsoptionsDict.has_key("lukscb") and \
self.fsoptionsDict["lukscb"].get_active() and \
- self.origrequest.format.type != "luks":
+ (self.origrequest.format.type != "luks" or
+ (self.origrequest.format.exists and
+ not self.origrequest.format.hasKey)):
luksdev = LUKSDevice("luks-%s" % self.origrequest.name,
format=format,
parents=self.origrequest)