[fix] Some service has no test_conf

Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
ljf (zamentur) 2021-09-02 20:09:41 +02:00 committed by GitHub
parent c5885000ec
commit e0fe82f566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1908,7 +1908,7 @@ def app_config_set(operation_logger, app, key=None, value=None, args=None, args_
logger.debug(f"Reloading {service}")
if not _run_service_command('reload-or-restart', service):
services = _get_services()
test_conf = services[service].get('test_conf')
test_conf = services[service].get('test_conf', 'true')
errors = check_output(f"{test_conf}; exit 0") if test_conf else ''
raise YunohostError(
"app_config_failed_service_reload",