summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2009-04-20 17:50:10 -0500
committerDavid Lehman <dlehman@redhat.com>2009-04-21 10:15:52 -0500
commit76ecf207e40be3b24c1813c7cfb38a505d4cacbe (patch)
tree48fd0abf924ee0f9760c21306de03a3b165d649c /iw
parent856191b9c07080ce0fb8a16068f800bb51311b15 (diff)
downloadanaconda-76ecf207e40be3b24c1813c7cfb38a505d4cacbe.tar.gz
anaconda-76ecf207e40be3b24c1813c7cfb38a505d4cacbe.tar.xz
anaconda-76ecf207e40be3b24c1813c7cfb38a505d4cacbe.zip
Fix preservation of format attrs for preexisting luks partitions.
When carrying over the format's attributes we do not consider the possiblility that the partition is encrypted, in which case we want to preserve the attributes of the LUKSDevice's - not the PartitionDevice's - format. This was causing a traceback whenever a user tried to edit a preexisting encrypted partition.
Diffstat (limited to 'iw')
-rw-r--r--iw/partition_dialog_gui.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/iw/partition_dialog_gui.py b/iw/partition_dialog_gui.py
index 03e9a592a..1e99b645e 100644
--- a/iw/partition_dialog_gui.py
+++ b/iw/partition_dialog_gui.py
@@ -214,6 +214,12 @@ class PartitionEditor:
else:
# preexisting partition, just set mount point and format flag
request = self.origrequest
+ if request.format.type == "luks":
+ usedev = self.storage.devicetree.getChildren(request)[0]
+ else:
+ usedev = request
+
+ origformat = usedev.format
mountpoint = self.mountCombo.get_children()[0].get_text()
devicetree = self.anaconda.id.storage.devicetree
@@ -223,17 +229,10 @@ class PartitionEditor:
# carry over exists, migrate, size, and device
# necessary for partition editor UI
- try:
- format = fmt_class(mountpoint=mountpoint,
- exists=request.format.exists,
- migrate=request.format.migrate,
- size=request.format.size,
- device=request.format.device)
- except AttributeError:
- format = fmt_class(mountpoint=mountpoint,
- exists=request.format.exists,
- migrate=request.format.migrate,
- device=request.format.device)
+ format = fmt_class(mountpoint=mountpoint,
+ exists=origformat.exists,
+ size=getattr(origformat, "size", None),
+ device=usedev.path)
luksdev = None
if self.fsoptionsDict.has_key("lukscb") and \
@@ -245,7 +244,7 @@ class PartitionEditor:
format = getFormat("luks",
device=self.origrequest.path,
passphrase=self.storage.encryptionPassphrase)
- actions.append(ActionCreateFormat(request, format))
+ actions.append(ActionCreateFormat(usedev, format))
if luksdev:
actions.append(ActionCreateDevice(luksdev))
actions.append(ActionCreateFormat(luksdev))
@@ -266,7 +265,7 @@ class PartitionEditor:
if self.fsoptionsDict.has_key("migratecb") and \
self.fsoptionsDict["migratecb"].get_active():
- actions.append(ActionMigrateFormat(request))
+ actions.append(ActionMigrateFormat(usedev))
if self.fsoptionsDict.has_key("resizecb") and \
self.fsoptionsDict["resizecb"].get_active():