[PATCH] Reset PartitionDevice attributes after failed edit. (#498026)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index e295e92..085abe6 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 "
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux