Skip to content

Commit cd9fef7

Browse files
committed
tui: show the disk on which an existing installation or backup is found
Adding disk vendor and model would be useful, but can take too much horizontal space, especially for good old 80x25 resolution, so we use a shorter string with just the disk size for disambiguation. Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
1 parent 426b328 commit cd9fef7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

diskutil.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,11 @@ def getHumanDiskName(disk):
392392
return disk[5:]
393393
return disk
394394

395-
def getHumanDiskLabel(disk):
395+
def getHumanDiskLabel(disk, short=False):
396396
(vendor, model, size) = getExtendedDiskInfo(disk)
397-
return "%s - %s [%s %s]" % (getHumanDiskName(disk), getHumanDiskSize(size), vendor, model)
397+
template = "{device} - {size} [{vendor} {model}]" if not short else "{device} - {size}"
398+
return template.format(device=getHumanDiskName(disk), size=getHumanDiskSize(size),
399+
vendor=vendor, model=model)
398400

399401
# given a list of disks, work out which ones are part of volume
400402
# groups that will cause a problem if we install XE to those disks:

tui/installer/screens.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,11 @@ def get_admin_interface_configuration(answers):
218218
def get_installation_type(answers):
219219
entries = []
220220
for x in answers['upgradeable-products']:
221-
entries.append(("Upgrade %s" % str(x), (x, x.settingsAvailable())))
221+
entries.append(("Upgrade %s on %s" % (x, diskutil.getHumanDiskLabel(x.primary_disk, short=True)),
222+
(x, x.settingsAvailable())))
222223
for b in answers['backups']:
223-
entries.append(("Restore %s from backup" % str(b), (b, None)))
224+
entries.append(("Restore %s from backup to %s" % (b, diskutil.getHumanDiskLabel(b.root_disk, short=True)),
225+
(b, None)))
224226

225227
entries.append( ("Perform clean installation", None) )
226228

0 commit comments

Comments
 (0)