[PATCH] Check for not having found any disks after populating the tree (#583906)

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

 



It is possible for us to not find any disks post the filter ui,
this can happen in 3 ways:
1. kickstart install (no filter ui, ignoreDisks)
2. text install (no filter ui)
3. gui install disk(s) selected in filter ui have no recognizable format
   and user clicked ignore

When this happens we currently backtrace in the clearpart ui as that
expects there to be atleast one disk. As there is very little we can
do without atleast one disk check for this condition in storageInitialize()
and allow the user to go back or exit the install. In the cmdline kickstart
install case this will result in the no disks found message being printed
and the installation stopping (it will trigger the cannot have a question in
cmdline mode code).
---
 storage/__init__.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 724ec88..85ee6cf 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -114,6 +114,16 @@ def storageInitialize(anaconda):
     else:
         storage.reset()
 
+    if not storage.disks:
+        rc = anaconda.intf.messageWindow(_("No disks found"),
+                _("No usable disks have been found."),
+                type="custom",
+                custom_buttons = [_("Back"), _("_Exit installer")],
+                default=0)
+        if rc == 0:
+            return DISPATCH_BACK
+        sys.exit(1)
+
 # dispatch.py helper function
 def storageComplete(anaconda):
     if anaconda.dir == DISPATCH_BACK:
-- 
1.7.0.1

_______________________________________________
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