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

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yeah, ok.

On Fri, 9 Oct 2009, David Lehman wrote:

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 "


- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkrPrG4ACgkQ5hsjjIy1Vkn8oACeKbbfpnK1ErRVn2aSZTj4JPoi
sv8AoPWCYmH/S2Cd8sgJqLuFs9ryD4MW
=83WM
-----END PGP SIGNATURE-----

_______________________________________________
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