[master/f20/rhel7 1/2] BootLoaderError should not reset storage (#1022418)

Brian C. Lane bcl at redhat.com
Wed Oct 23 22:57:40 UTC 2013


From: "Brian C. Lane" <bcl at redhat.com>

Resetting storage can cause problems, eg. if custom is about to be run.
Really we just need to show the error and reset bootDrive.

Related: rhbz#1022418
---
 pyanaconda/ui/gui/spokes/storage.py | 7 ++++++-
 pyanaconda/ui/tui/spokes/storage.py | 8 +++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index df28311..9951e41 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -400,7 +400,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
         hubQ.send_message(self.__class__.__name__, _("Saving storage configuration..."))
         try:
             doKickstartStorage(self.storage, self.data, self.instclass)
-        except (StorageError, BootLoaderError, KickstartValueError) as e:
+        except (StorageError, KickstartValueError) as e:
             log.error("storage configuration failed: %s" % e)
             StorageChecker.errors = str(e).split("\n")
             hubQ.send_message(self.__class__.__name__, _("Failed to save storage configuration..."))
@@ -412,6 +412,11 @@ class StorageSpoke(NormalSpoke, StorageChecker):
             self.disks = getDisks(self.storage.devicetree)
             # now set ksdata back to the user's specified config
             self._applyDiskSelection(self.selected_disks)
+        except BootLoaderError as e:
+            log.error("BootLoader setup failed: %s", e)
+            StorageChecker.errors = str(e).split("\n")
+            hubQ.send_message(self.__class__.__name__, _("Failed to save storage configuration..."))
+            self.data.bootloader.bootDrive = ""
         else:
             if self.autopart:
                 # this was already run as part of doAutoPartition. dumb.
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index 0790a45..13d2c1f 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -253,7 +253,7 @@ class StorageSpoke(NormalTUISpoke):
         print(_("Generating updated storage configuration"))
         try:
             doKickstartStorage(self.storage, self.data, self.instclass)
-        except (StorageError, BootLoaderError, KickstartValueError) as e:
+        except (StorageError, KickstartValueError) as e:
             log.error("storage configuration failed: %s" % e)
             print _("storage configuration failed: %s") % e
             self.errors = [str(e)]
@@ -264,6 +264,12 @@ class StorageSpoke(NormalTUISpoke):
             self.storage.autoPartType = self.data.clearpart.type
             self.storage.reset()
             self._ready = True
+        except BootLoaderError as e:
+            log.error("BootLoader setup failed: %s", e)
+            print _("storage configuration failed: %s") % e
+            self.errors = [str(e)]
+            self.data.bootloader.bootDrive = ""
+            self._ready = True
         else:
             print(_("Checking storage configuration..."))
             (self.errors, self.warnings) = self.storage.sanityCheck()
-- 
1.8.3.1



More information about the anaconda-patches mailing list