From 2bd220c28016ca46b5e44235c08f384ea1e8f44f Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 9 Mar 2021 16:13:21 +0100 Subject: Moved everything into a function block rather than having everything on a line by line situation. This just helps separate what the two major components/blocks are of the guided profile. The change was done in the previous commit, but a spelling mistake was made here and I forgot to mention it in the already long commit log. But user-questions is now in one function. Installation steps are now in a two-tier function, one for setup and one for install steps. --- examples/guided.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/examples/guided.py b/examples/guided.py index 28d07d0f..9d242842 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -60,15 +60,21 @@ def perform_installation(device, boot_partition, language, mirrors): installation.install_profile(profile) if archinstall.arguments.get('users', None): - for user, password in archinstall.arguments.get('users').items(): + for user in archinstall.arguments.get('users'): + password = users[user] installation.user_create(user, password, sudo=False) - if archinstall.arguments.get('superusers', None): - for user, password in archinstall.arguments.get('superusers').items(): - installation.user_create(user, password, sudo=True) + for user in archinstall.arguments.get('users'): + password = users[user] + installation.user_create(user, password, sudo=Tru) + + # sudo = False + # if 'root_pw' not in archinstall.storage['_guided_hidden'] or len(archinstall.storage['_guided_hidden']['root_pw'].strip()) == 0: + # sudo = True + - if (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw): - installation.user_set_pw('root', root_pw) + if 'root_pw' in archinstall.storage['_guided_hidden'] and archinstall.storage['_guided_hidden']['root_pw']: + installation.user_set_pw('root', archinstall.storage['_guided_hidden']['root_pw']) def ask_user_questions(): """ @@ -322,4 +328,4 @@ def perform_installation_steps(): mirrors=archinstall.arguments['mirror-region']) ask_user_questions() -perform_pre_installation_steps() \ No newline at end of file +perform_installation_steps() \ No newline at end of file -- cgit v1.2.3-70-g09d2