Skip to content

linux installer: skip interactive prompt for username/password if already known #384

Description

@dolmen

In the linux installer, when the username and password are already provided via command line flags (--username, --password) the interactive prompt should either:

  • be totally skipped (my preference)
  • or dialog must be prepopulated with the known values

See function __get_username_password

def __get_username_password(self) -> None:
"""
read user password and set the password property
do nothing if silent mode is set
"""
if self.silent:
return
if self.graphics in ('tkinter', 'zenity', 'yad'):
self.__get_username_password_atomic()
else:
password = "a"
password1 = "b"
if self.username:
user_prompt = self.username
elif Config.hint_user_input:
user_prompt = '@' + Config.user_realm
else:
user_prompt = ''
while True:
self.username = self.prompt_nonempty_string(
1, Messages.username_prompt, user_prompt)
if self.__validate_user_name():
break
while password != password1:
password = self.prompt_nonempty_string(
0, Messages.enter_password)
password1 = self.prompt_nonempty_string(
0, Messages.repeat_password)
if password != password1:
self.alert(Messages.passwords_differ)
self.password = password

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions