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

Re: [PATCH] Fix upgrade selected in UI after partitioning step (and back) (#503302)

Chris Lumens wrote:

Also, having to mangle the dir variable is kind of gross.  Perhaps we
should break out the logic of findRootParts into its own method without
the direction checking so we can call that from here too.

How about attched patch. It resets rootParts to None in storage reset
and checks it in findinstall UI step, eventually finding root partitions
if needed.

>From bef62e40a5c171d433834794f33dcd61690e3382 Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal redhat com>
Date: Mon, 8 Jun 2009 17:24:33 +0200
Subject: [PATCH] Fix upgrade selected in UI after storage reset (e.g. in partitioning UI) (#503302)

Fix of this UI flow: doing storage reset after root partitions discovery (e.g.
in partitioning step) and then going back and selecting upgrade. In place of
using root partition device objects obsoleted by storage reset, find root
partition devices of new device tree.
 iw/examine_gui.py   |    6 ++++++
 storage/__init__.py |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/iw/examine_gui.py b/iw/examine_gui.py
index 334f3d1..e6fda9c 100644
--- a/iw/examine_gui.py
+++ b/iw/examine_gui.py
@@ -90,6 +90,12 @@ class UpgradeExamineWindow (InstallWindow):
 	    self.doupgrade = self.anaconda.id.upgrade
+        # we might get here after storage reset that obsoleted
+        # root devices we had found
+        if not self.anaconda.id.rootParts:
+            self.anaconda.id.rootParts = upgrade.findExistingRoots(self.anaconda)
+            self.anaconda.id.upgradeRoot = self.anaconda.id.rootParts[:]
         self.parts = self.anaconda.id.rootParts 
         vbox = gtk.VBox (False, 10)
diff --git a/storage/__init__.py b/storage/__init__.py
index a364bf8..685b59e 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -298,6 +298,8 @@ class Storage(object):
         self.fsset = FSSet(self.devicetree)
+        self.anaconda.id.rootParts = None
+        self.anaconda.id.upgradeRoot = None

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