Added error handling to guided.py when not selecting a profile to install.

This commit is contained in:
Anton Hvornum 2020-10-18 13:20:58 +02:00
parent 0e8130af9a
commit 9c5d1e9891
2 changed files with 4 additions and 6 deletions

View File

@ -81,11 +81,9 @@ def select_profile(options):
print(' -- (Leave blank to skip this next optional step) --')
selected_profile = input('Any particular pre-programmed profile you want to install: ')
#print(' -- You can enter ? or help to search for more profiles --')
#if selected_profile.lower() in ('?', 'help'):
# filter_string = input('Search for layout containing (example: "sv-"): ')
# new_options = search_keyboard_layout(filter_string)
# return select_language(new_options)
if len(selected_profile.strip()) <= 0:
return None
if selected_profile.isdigit() and (pos := int(selected_profile)) <= len(profiles)-1:
selected_profile = profiles[pos]
elif selected_profile in options:

View File

@ -24,7 +24,7 @@ def perform_installation(device, boot_partition, language, mirrors):
if len(packages) and packages[0] != '':
installation.add_additional_packages(packages)
if len(profile.strip()):
if profile and len(profile.strip()):
installation.install_profile(profile)
for user, password in users.items():