diff options
author | David Lehman <dlehman@redhat.com> | 2009-10-09 13:19:26 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-10-09 16:45:59 -0500 |
commit | aaf3a0d41399a679401a97812705533702787da4 (patch) | |
tree | 3503301a4edf07fd1449caeb33845b56cdfdc4d9 /iw | |
parent | fd7e41886979d5c71a5f2cbcbea73092a13cce57 (diff) | |
download | anaconda-aaf3a0d41399a679401a97812705533702787da4.tar.gz anaconda-aaf3a0d41399a679401a97812705533702787da4.tar.xz anaconda-aaf3a0d41399a679401a97812705533702787da4.zip |
Reset PartitionDevice attributes after failed edit. (#498026)
If we are editing, not creating, we overwite several attributes
instead of creating a new device/action pair. Since these changes
have no corresponding action they need to be reversed manually.
Diffstat (limited to 'iw')
-rw-r--r-- | iw/partition_gui.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/iw/partition_gui.py b/iw/partition_gui.py index e295e92be..085abe60b 100644 --- a/iw/partition_gui.py +++ b/iw/partition_gui.py @@ -31,6 +31,7 @@ import gui import parted import string import types +import copy from constants import * import storage @@ -1118,8 +1119,9 @@ class PartitionWindow(InstallWindow): isNew = isNew, restrictfs = restrictfs) - while 1: - actions = parteditor.run() + while 1: + orig_device = copy.copy(device) + actions = parteditor.run() for action in actions: # XXX we should handle exceptions here @@ -1132,6 +1134,15 @@ class PartitionWindow(InstallWindow): for action in actions: self.anaconda.id.storage.devicetree.cancelAction(action) + # hack + if not isNew: + device.req_size = orig_device.req_size + device.req_base_size = orig_device.req_base_size + device.req_grow = orig_device.req_grow + device.req_max_size = orig_device.req_max_size + device.req_primary = orig_device.req_primary + device.req_disks = orig_device.req_disks + if self.refresh(): # this worked before and doesn't now... raise RuntimeError, ("Returning partitions to state " |