Skip to content

Commit

Permalink
tui: show the disk on which an existing installation or backup is found
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ydirson committed Dec 15, 2022
1 parent fc45c60 commit 97052fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions diskutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,11 @@ def getHumanDiskName(disk):
return disk[5:]
return disk

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

# given a list of disks, work out which ones are part of volume
# groups that will cause a problem if we install XE to those disks:
Expand Down
6 changes: 4 additions & 2 deletions tui/installer/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ def get_admin_interface_configuration(answers):
def get_installation_type(answers):
entries = []
for x in answers['upgradeable-products']:
entries.append(("Upgrade %s" % str(x), (x, x.settingsAvailable())))
entries.append(("Upgrade %s on %s" % (x, diskutil.getHumanDiskLabel(x.primary_disk, short=True)),
(x, x.settingsAvailable())))
for b in answers['backups']:
entries.append(("Restore %s from backup" % str(b), (b, None)))
entries.append(("Restore %s from backup to %s" % (b, diskutil.getHumanDiskLabel(b.root_disk, short=True)),
(b, None)))

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

Expand Down

0 comments on commit 97052fc

Please sign in to comment.