[PATCH 3/4] Present an error message if no disks are detected (#864093).
Chris Lumens
clumens at redhat.com
Mon Oct 8 20:18:43 UTC 2012
---
pyanaconda/storage/__init__.py | 3 ---
pyanaconda/ui/gui/spokes/lib/cart.py | 3 +++
pyanaconda/ui/gui/spokes/storage.py | 4 +++-
pyanaconda/ui/tui/spokes/storage.py | 4 +++-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 8239e6f..c506ed8 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -103,9 +103,6 @@ def storageInitialize(storage, ksdata, protected):
else:
storage.reset()
- if not storage.disks:
- raise NoDisksError
-
# kickstart uses all the disks
if flags.automatedInstall:
if not ksdata.ignoredisk.onlyuse:
diff --git a/pyanaconda/ui/gui/spokes/lib/cart.py b/pyanaconda/ui/gui/spokes/lib/cart.py
index 1b46bc2..ed4f1f7 100644
--- a/pyanaconda/ui/gui/spokes/lib/cart.py
+++ b/pyanaconda/ui/gui/spokes/lib/cart.py
@@ -65,6 +65,9 @@ class SelectedDisksDialog(GUIObject):
if not showRemove:
self.builder.get_object("remove_button").hide()
+ if not disks:
+ return
+
# Set up the default boot device. Use what's in the ksdata if anything,
# then fall back to the first device.
default_id = None
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 537781a..5bee70c 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -531,7 +531,9 @@ class StorageSpoke(NormalSpoke, StorageChecker):
summary_label = self.builder.get_object("summary_label")
summary_label.set_text(summary)
- if count == 0:
+ if len(self.disks) == 0:
+ self.window.set_info(Gtk.MessageType.WARNING, _("No disks detected. Please shut down the computer, connect at least one disk, and restart to complete installation."))
+ elif count == 0:
self.window.set_info(Gtk.MessageType.WARNING, _("No disks selected; please select at least one disk to install to."))
else:
self.window.clear_info()
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index afa2855..c0a7cdd 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -163,7 +163,9 @@ class StorageSpoke(NormalTUISpoke):
("%d disks selected; %s capacity; %s free ..."),
count) % (count, str(Size(spec="%s MB" % capacity)), free))
- if count == 0:
+ if len(self.disks) == 0:
+ summary = _("No disks detected. Please shut down the computer, connect at least one disk, and restart to complete installation.")
+ elif count == 0:
summary = (_("No disks selected; please select at least one disk to install to."))
return summary
--
1.7.11.2
More information about the anaconda-patches
mailing list