summaryrefslogtreecommitdiffstats
path: root/iw/partition_dialog_gui.py
diff options
context:
space:
mode:
Diffstat (limited to 'iw/partition_dialog_gui.py')
-rw-r--r--iw/partition_dialog_gui.py9
1 files changed, 7 insertions, 2 deletions
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)