[master 1/1] Do not override StorageChecker.errors in StorageSpoke (#1252596)

vojtechtrefny installerbot-noreply at redhat.com
Wed Sep 30 09:35:59 UTC 2015


From: Vojtech Trefny <vtrefny at redhat.com>

When assigning checkDiskSelection result to self.errors, we can
lose errors from CustomPartitioningSpoke. Added separate "category"
for disk selection errors to fix this.

Signed-off-by: Vojtech Trefny <vtrefny at redhat.com>
---
 pyanaconda/ui/gui/spokes/storage.py | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 181e97c..70e3517 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -268,6 +268,7 @@ def __init__(self, *args, **kwargs):
         self._last_selected_disks = None
         self._back_clicked = False
         self.autopart_missing_passphrase = False
+        self.disks_errors = []
 
         # This list contains all possible disks that can be included in the install.
         # All types of advanced disks should be set up for us ahead of time, so
@@ -903,8 +904,11 @@ def on_back_clicked(self, button):
 
         # make sure no containers were split up by the user's disk selection
         self.clear_info()
-        self.errors = checkDiskSelection(self.storage, self.selected_disks)
-        if self.errors:
+
+        # if there are some disk selection errors we don't let user to leave the
+        # spoke, so these errors don't have to go to self.errors
+        self.disks_errors = checkDiskSelection(self.storage, self.selected_disks)
+        if self.disks_errors:
             # The disk selection has to make sense before we can proceed.
             self.set_error(_("There was a problem with your disk selection. "
                              "Click here for details."))
@@ -1014,7 +1018,28 @@ def on_specialized_clicked(self, button):
         NormalSpoke.on_back_clicked(self, button)
 
     def on_info_bar_clicked(self, *args):
-        if self.errors:
+        if self.disks_errors:
+            label = _("The following errors were encountered when checking your disk "
+                      "selection. You can modify your selection or quit the "
+                      "installer.")
+
+            dialog = DetailedErrorDialog(self.data, buttons=[
+                    C_("GUI|Storage|Error Dialog", "_Quit"),
+                    C_("GUI|Storage|Error Dialog", "_Modify Disk Selection")],
+                label=label)
+            with self.main_window.enlightbox(dialog.window):
+                errors = "\n".join(self.disks_errors)
+                dialog.refresh(errors)
+                rc = dialog.run()
+
+            dialog.window.destroy()
+
+            if rc == 0:
+                # Quit.
+                iutil.ipmi_report(constants.IPMI_ABORTED)
+                sys.exit(0)
+
+        elif self.errors:
             label = _("The following errors were encountered when checking your storage "
                       "configuration.  You can modify your storage layout or quit the "
                       "installer.")


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/53bfc00d43f7be0c966705b9cef346a37817ed99


More information about the anaconda-patches mailing list