pmb.config.init: Fix types in ask_for_systemd() (MR 2490)

pmb.helpers.cli.ask() returns a string, so previously this function was
just lying about its return type (which happened to be fine in the
context it was used, but still not what we want).
This commit is contained in:
Newbyte 2024-11-15 13:44:33 +01:00
parent 87900112c1
commit 73091016ae
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -263,11 +263,11 @@ def ask_for_systemd(config: Config, ui: str) -> SystemdConfig:
answer = pmb.helpers.cli.ask( answer = pmb.helpers.cli.ask(
"Install systemd?", "Install systemd?",
choices, choices,
config.systemd, str(config.systemd),
validation_regex=f"^({'|'.join(choices)})$", validation_regex=f"^({'|'.join(choices)})$",
complete=choices, complete=choices,
) )
return answer return SystemdConfig(answer)
def ask_for_keymaps(config: Config, deviceinfo: Deviceinfo) -> str: def ask_for_keymaps(config: Config, deviceinfo: Deviceinfo) -> str: