summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iw/partition_gui.py17
-rw-r--r--textw/partition_text.py15
2 files changed, 32 insertions, 0 deletions
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 7e6ffa57b..97443f854 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -79,6 +79,7 @@ new_checkmark = new_checkmark + "\0\0\0\0\0\0\0\0\0\0\15\0\0\0r\0\0\0\263\0\0\0i
new_checkmark = new_checkmark + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0g\0\0"
new_checkmark = new_checkmark + "\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+
class DiskStripeSlice:
def eventHandler(self, widget, event):
if event.type == gtk.gdk.BUTTON_PRESS:
@@ -944,10 +945,26 @@ class PartitionWindow(InstallWindow):
def refresh(self):
self.diskStripeGraph.shutDown()
self.tree.clear()
+
+ # XXXX - Backup some info which doPartitioning munges if it fails
+ origInfoDict = {}
+ for request in self.partitions.requests:
+ try:
+ origInfoDict[request.uniqueID] = (request.requestSize, request.currentDrive)
+ except:
+ pass
+
try:
autopart.doPartitioning(self.diskset, self.partitions)
rc = 0
except PartitioningError, msg:
+ try:
+ for request in self.partitions.requests:
+ if request.uniqueID in origInfoDict.keys():
+ (request.requestSize, request.currentDrive) = origInfoDict[request.uniqueID]
+ except:
+ log("Failed to restore original info")
+
self.intf.messageWindow(_("Error Partitioning"),
_("Could not allocate requested partitions: %s.") % (msg),
custom_icon="error")
diff --git a/textw/partition_text.py b/textw/partition_text.py
index 9ee81cca9..01ef4ca6e 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -191,10 +191,25 @@ class PartitionWindow:
# XXX need some way to stay at the same place in the list after
# repopulating
+ # XXXX - Backup some info which doPartitioning munges if it fails
+ origInfoDict = {}
+ for request in self.partitions.requests:
+ try:
+ origInfoDict[request.uniqueID] = (request.requestSize, request.currentDrive)
+ except:
+ pass
+
try:
doPartitioning(self.diskset, self.partitions)
rc = 0
except PartitioningError, msg:
+ try:
+ for request in self.partitions.requests:
+ if request.uniqueID in origInfoDict.keys():
+ (request.requestSize, request.currentDrive) = origInfoDict[request.uniqueID]
+ except:
+ log("Failed to restore original info")
+
self.intf.messageWindow(_("Error Partitioning"),
_("Could not allocate requested partitions: %s.") % (msg))
rc = -1