diff options
author | David Cantrell <dcantrell@redhat.com> | 2008-09-11 15:02:34 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2008-09-11 15:02:34 -1000 |
commit | 9efcc6a4a983ed006a6b6e7a86f4e70bcc07c2d2 (patch) | |
tree | e268efcb8b5c2f2b8cb4930e4cb615973b60a57e | |
parent | dd6ef534caf84da41e58e9a713d687bda297e4fa (diff) | |
download | anaconda-9efcc6a4a983ed006a6b6e7a86f4e70bcc07c2d2.tar.gz anaconda-9efcc6a4a983ed006a6b6e7a86f4e70bcc07c2d2.tar.xz anaconda-9efcc6a4a983ed006a6b6e7a86f4e70bcc07c2d2.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.
-rw-r--r-- | autopart.py | 20 | ||||
-rw-r--r-- | partedUtils.py | 7 |
2 files changed, 13 insertions, 14 deletions
diff --git a/autopart.py b/autopart.py index 5cc00aa4e..e1a10312e 100644 --- a/autopart.py +++ b/autopart.py @@ -1679,20 +1679,16 @@ def queryAutoPartitionOK(anaconda): drives.sort() width = 44 - str = "" - maxlen = 0 for drive in drives: - if (len(drive) > maxlen): - maxlen = len(drive) - maxlen = maxlen + 8 # 5 for /dev/, 3 for spaces - for drive in drives: - if (len(str) + maxlen <= width): - str = str + "%-*s" % (maxlen, "/dev/"+drive) + deviceFile = isys.makeDevInode(drive, "/dev/" + drive) + dev = parted.PedDevice.get(deviceFile) + str = "%s (%s %-0.f MB)" % (drive, dev.model, partedUtils.getDeviceSizeMB (dev)) + if len (str) <= width: + drvstr = drvstr + str + "\n" else: - drvstr = drvstr + str + "\n" - str = "" - str = "%-*s" % (maxlen, "/dev/"+drive) - drvstr = drvstr + str + "\n" + while len (str) > 0: + drvstr = drvstr + str[:width] + "\n" + str = str[width:] rc = anaconda.intf.messageWindow(_("Warning"), _(msg) % drvstr, type="yesno", default="no", custom_icon ="warning") diff --git a/partedUtils.py b/partedUtils.py index 5a4739d62..6a8fa6343 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -1112,14 +1112,17 @@ class DiskSet: self._removeDisk(drive) return False - msg = _("The partition table on device %s was unreadable. " + deviceFile = isys.makeDevInode(drive, "/dev/" + drive) + dev = parted.PedDevice.get(deviceFile) + + msg = _("The partition table on device %s (%s %-0.f MB) was unreadable.\n" "To create new partitions it must be initialized, " "causing the loss of ALL DATA on this drive.\n\n" "This operation will override any previous " "installation choices about which drives to " "ignore.\n\n" "Would you like to initialize this drive, " - "erasing ALL DATA?") % (drive,) + "erasing ALL DATA?") % (drive, dev.model, getDeviceSizeMB (dev),) if rhpl.getArch() == "s390" \ and drive[:4] == "dasd" \ |