Simplifying the profile loading a bit, and adding some debugging for it.

This commit is contained in:
Anton Hvornum 2021-02-17 13:59:44 +01:00
parent 03a69eba2e
commit 758b12e674
2 changed files with 3 additions and 2 deletions

View File

@ -188,9 +188,9 @@ def select_profile(options):
if '__name__' in source_data and '_prep_function' in source_data:
with profile.load_instructions(namespace=f"{selected_profile}.py") as imported:
if hasattr(imported, '_prep_function'):
return profile, imported
return imported
return selected_profile
return profile
raise RequirementError("Selecting profiles require a least one profile to be given as an option.")

View File

@ -185,6 +185,7 @@ else:
archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]
# Check the potentially selected profiles preperations to get early checks if some additional questions are needed.
print(archinstall.arguments['profile'])
if archinstall.arguments['profile']:
if not archinstall.arguments['profile']._prep_function():
archinstall.log(