Skip to content

Commit cfa15aa

Browse files
ydirsonGeraldEV
authored andcommitted
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 b0b3be5 commit cfa15aa

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

diskutil.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,11 @@ def getHumanDiskName(disk):
389389
return disk[5:]
390390
return disk
391391

392-
def getHumanDiskLabel(disk):
392+
def getHumanDiskLabel(disk, short=False):
393393
(vendor, model, size) = getExtendedDiskInfo(disk)
394-
return "%s - %s [%s %s]" % (getHumanDiskName(disk), getHumanDiskSize(size), vendor, model)
394+
template = "{device} - {size} [{vendor} {model}]" if not short else "{device} - {size}"
395+
return template.format(device=getHumanDiskName(disk), size=getHumanDiskSize(size),
396+
vendor=vendor, model=model)
395397

396398
# given a list of disks, work out which ones are part of volume
397399
# 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
@@ -221,9 +221,11 @@ def get_admin_interface_configuration(answers):
221221
def get_installation_type(answers):
222222
entries = []
223223
for x in answers['upgradeable-products']:
224-
entries.append(("Upgrade %s" % str(x), (x, x.settingsAvailable())))
224+
entries.append(("Upgrade %s on %s" % (x, diskutil.getHumanDiskLabel(x.primary_disk, short=True)),
225+
(x, x.settingsAvailable())))
225226
for b in answers['backups']:
226-
entries.append(("Restore %s from backup" % str(b), (b, None)))
227+
entries.append(("Restore %s from backup to %s" % (b, diskutil.getHumanDiskLabel(b.root_disk, short=True)),
228+
(b, None)))
227229

228230
entries.append( ("Perform clean installation", None) )
229231

0 commit comments

Comments
 (0)