Skip to content

Commit 116df4e

Browse files
ydirsonbenjamreis
authored andcommitted
Always show "Select Primary Disk" screen (fixes #7)
Skipping the primary disk slection when there is only one caused several problems: - hitting "Back" from "Virtual Machine Storage" screen tries to get back to primary disk selection, and finally has no effect - users are sometimes confusing the disk selection for VM storage with the selection of primary disk Signed-off-by: Yann Dirson <yann.dirson@vates.fr>
1 parent a220bcf commit 116df4e

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

tui/installer/screens.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -569,32 +569,28 @@ def select_primary_disk(answers):
569569
['Cancel'])
570570
return EXIT
571571

572-
# if only one disk, set default:
573-
if len(entries) == 1:
574-
answers['primary-disk'] = entries[0][1]
575-
else:
576-
# default value:
577-
default = None
578-
if 'primary-disk' in answers:
579-
default = selectDefault(answers['primary-disk'], entries)
572+
# default value:
573+
default = None
574+
if 'primary-disk' in answers:
575+
default = selectDefault(answers['primary-disk'], entries)
580576

581-
tui.update_help_line([None, "<F5> more info"])
577+
tui.update_help_line([None, "<F5> more info"])
582578

583-
scroll, height = snackutil.scrollHeight(4, len(entries))
584-
(button, entry) = snackutil.ListboxChoiceWindowEx(
585-
tui.screen,
586-
"Select Primary Disk",
587-
"""Please select the disk you would like to install %s on (disks with insufficient space are not shown).
579+
scroll, height = snackutil.scrollHeight(4, len(entries))
580+
(button, entry) = snackutil.ListboxChoiceWindowEx(
581+
tui.screen,
582+
"Select Primary Disk",
583+
"""Please select the disk you would like to install %s on (disks with insufficient space are not shown).
588584
589585
You may need to change your system settings to boot from this disk.""" % (MY_PRODUCT_BRAND),
590-
entries,
591-
['Ok', 'Back'], 55, scroll, height, default, help='pridisk:info',
592-
hotkeys={'F5': disk_more_info})
586+
entries,
587+
['Ok', 'Back'], 55, scroll, height, default, help='pridisk:info',
588+
hotkeys={'F5': disk_more_info})
593589

594-
tui.screen.popHelpLine()
590+
tui.screen.popHelpLine()
595591

596-
# entry contains the 'de' part of the tuple passed in
597-
answers['primary-disk'] = entry
592+
# entry contains the 'de' part of the tuple passed in
593+
answers['primary-disk'] = entry
598594

599595
if 'installation-to-overwrite' in answers:
600596
answers['target-is-sr'] = target_is_sr[answers['primary-disk']]

0 commit comments

Comments
 (0)