From aaf3a0d41399a679401a97812705533702787da4 Mon Sep 17 00:00:00 2001 From: David Lehman Date: Fri, 9 Oct 2009 13:19:26 -0500 Subject: 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. --- iw/partition_gui.py | 15 +++++++++++++-- 1 file 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 " -- cgit