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:
Caleb Connolly 2024-06-09 03:27:45 +02:00 committed by Oliver Smith
parent 7a8deb0f5e
commit 1a01738d50
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
6 changed files with 39 additions and 43 deletions

View file

@ -228,7 +228,6 @@ def config(args: PmbArgs):
pmb.config.save(args.config, config)
elif args.value is not None:
setattr(config, args.name, args.value)
pmb.config.sanity_checks(config)
logging.info("Config changed: " + args.name + "='" + args.value + "'")
pmb.config.save(args.config, config)
elif args.name: