enhancement(src/risotto/image.py): better messages

close #11
This commit is contained in:
egarette@silique.fr 2023-08-01 14:58:22 +02:00
parent 55b0140edd
commit 8e6dd476bf

View file

@ -230,12 +230,12 @@ def valid_mandatories(config):
var_server_name = config.option(path_server_name).description() var_server_name = config.option(path_server_name).description()
if server_name != var_server_name: if server_name != var_server_name:
server_name = var_server_name server_name = var_server_name
title = f'=== Missing variables for {server_name} ===' title = f'=== Missing variables for "{server_name.split(".", 1)[0]}" ==='
text = mandatory_option.doc() text = mandatory_option.doc()
msg = f' - {text} ({path})' msg = f' - {text} ({path})'
supplier = mandatory_option.information.get('supplier', None) supplier = mandatory_option.information.get('supplier', None)
if supplier: if supplier and not ':' in supplier:
msg += f' you could add a service that provides "{supplier}"' msg += f' you should add a service that provides "{supplier}"'
if mandatory_option.isfollower(): if mandatory_option.isfollower():
leader = mandatory_option.leader() leader = mandatory_option.leader()
try: try: