From 96bd6f8deb5683475bb5daa23ad2489419e909cc Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 18 Feb 2019 18:50:46 +0100 Subject: [PATCH] Fix a few things for service_regen_conf backward compatibility --- src/yunohost/service.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index d088f0029..56cac7a55 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -414,12 +414,20 @@ def service_regen_conf(names=[], with_diff=False, force=False, dry_run=False, list_pending=False): services = _get_services() + + if isinstance(names, str): + names = [names] + for name in names: - if name not in services: - raise YunohostError('service_unknown', service=service) + if name not in services.keys(): + raise YunohostError('service_unknown', service=name) + + if names is []: + names = services.keys() logger.warning(m18n.n("service_regen_conf_is_deprecated")) + from yunohost.regenconf import regen_conf return regen_conf(names, with_diff, force, dry_run, list_pending)