forked from Mirror/pmbootstrap
config: sanity check via types (MR 2252)
Replace the "sanity_check" code with type checking built into the Config __setattr__ operator. This keeps all the Config related code in one place. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
7a8deb0f5e
commit
1a01738d50
6 changed files with 39 additions and 43 deletions
|
@ -2,6 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
from pmb.core import get_context
|
||||
from pmb.core.chroot import Chroot
|
||||
from pmb.core.config import SystemdConfig
|
||||
from pmb.core.context import Context
|
||||
from pmb.core.pkgrepo import pkgrepo_default_path
|
||||
from pmb.helpers import logging
|
||||
|
@ -211,7 +212,7 @@ def ask_for_systemd(config: Config, ui):
|
|||
logging.info("Based on your UI selection, 'default' will result"
|
||||
f" in{not_str}installing systemd.")
|
||||
|
||||
choices = pmb.config.allowed_values["systemd"]
|
||||
choices = SystemdConfig.choices()
|
||||
answer = pmb.helpers.cli.ask("Install systemd?",
|
||||
choices,
|
||||
config.systemd,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue