fix: better warnings

This commit is contained in:
egarette@silique.fr 2026-03-26 08:50:20 +01:00
parent 437664e95a
commit 38f1e9bc4e

View file

@ -65,7 +65,7 @@ def _main(arguments, do_not_print):
layer_datas, metaconfig, config, err_warn = load_user_data(rougailconfig) layer_datas, metaconfig, config, err_warn = load_user_data(rougailconfig)
if config and (not rougailconfig["cli.load_config"] or not rougailconfig["cli.read_write"]): if config and (not rougailconfig["cli.load_config"] or not rougailconfig["cli.read_write"]):
config.property.read_only() config.property.read_only()
if rougailconfig["cli.mandatory"]: if config and rougailconfig["cli.mandatory"]:
mandatories(config, err_warn["errors"]) mandatories(config, err_warn["errors"])
output = get_output(rougailconfig, output = get_output(rougailconfig,
metaconfig, metaconfig,
@ -113,7 +113,7 @@ def load_cmd_user_data(rougailconfig, arguments):
if var: if var:
warn(UserWarning(f'unable to load "{var.option.impl_get_display_name(var)}", {str(w)}')) warn(UserWarning(f'unable to load "{var.option.impl_get_display_name(var)}", {str(w)}'))
else: else:
warn(UserWarning(f'{str(w)}')) warn(w)
else: else:
warn(warning) warn(warning)
if manage_warnings: if manage_warnings: