summaryrefslogtreecommitdiffstats
path: root/storage/devicetree.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2009-07-02 19:44:27 -1000
committerDavid Cantrell <dcantrell@redhat.com>2009-07-13 14:07:29 -1000
commit7e220fa8a708acbdd8c4fb4865d9bf589bd065bd (patch)
treec6f8601c4852b8cf598a6f7f6f12e742f77b052d /storage/devicetree.py
parent0976bfe694947a3617f9fcf124c68baec90d87ad (diff)
downloadanaconda-7e220fa8a708acbdd8c4fb4865d9bf589bd065bd.tar.gz
anaconda-7e220fa8a708acbdd8c4fb4865d9bf589bd065bd.tar.xz
anaconda-7e220fa8a708acbdd8c4fb4865d9bf589bd065bd.zip
Display drive model and size in MB in partitioning UI (#460697)
When a partition table is unreadable, anaconda displays a window explaining the situation and asks you if you would like to format the disk for use. The existing message would only give the device node name (e.g., /dev/sda47). This patch adds the drive model name and capacity to the message so confused users might know which disk anaconda is talking about.
Diffstat (limited to 'storage/devicetree.py')
-rw-r--r--storage/devicetree.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/storage/devicetree.py b/storage/devicetree.py
index b856c6c19..41a8093e6 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -126,10 +126,24 @@ def questionInitializeDisk(intf=None, name=None):
if not intf or not name:
pass
else:
+ if not name.startswith('/dev/'):
+ devpath = '/dev/' + name
+ else:
+ devpath = name
+
+ dev = parted.getDevice(devpath)
+ bypath = deviceNameToDiskByPath(name)
+ details = ""
+
+ if bypath:
+ details = "\n\nDevice details:\n%s" % (bypath,)
+
rc = intf.messageWindow(_("Warning"),
- _("Error processing drive %s.\n"
- "Maybe it needs to be reinitialized. "
- "YOU WILL LOSE ALL DATA ON THIS DRIVE!") % (name,),
+ _("Error processing drive %s %-0.fMB (%s).\n\n"
+ "Maybe it needs to be reinitialized. YOU "
+ "WILL LOSE ALL DATA ON THIS DRIVE IF YOU "
+ "REINITIALIZE IT!%s")
+ % (name, dev.getSize(), dev.model, details,),
type="custom",
custom_buttons = [ _("_Ignore drive"),
_("_Re-initialize drive") ],