From bcb16416b2c259b04ef97da74ed5b141209911a3 Mon Sep 17 00:00:00 2001 From: Augustin Trancart Date: Fri, 8 May 2020 17:59:46 +0200 Subject: [PATCH 1/2] Remove default value for deprecated log_type args The service_add method check if the argument is empty, but what it really wants to do is checking if the args is not systemd (as far as I understand). As this value is deprecated, better remove the default to fix this logic. --- data/actionsmap/yunohost.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index a748e4533..e2b4447cf 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -996,7 +996,6 @@ service: choices: - file - systemd - default: file --test_status: help: Specify a custom bash command to check the status of the service. Note that it only makes sense to specify this if the corresponding systemd service does not return the proper information already. --test_conf: From a8d52eb1d4343c205a55b10e85445b8a87df9072 Mon Sep 17 00:00:00 2001 From: Augustin Trancart Date: Fri, 8 May 2020 18:05:49 +0200 Subject: [PATCH 2/2] Avoid crashing when service name is not provided as log source --- src/yunohost/service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index a048c5a41..40a0fcc0b 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -70,7 +70,8 @@ def service_add(name, description=None, log=None, log_type=None, test_status=Non if log_type is not None: logger.warning("/!\\ Packagers! --log_type is deprecated. You do not need to specify --log_type systemd anymore ... Yunohost now automatically fetch the journalctl of the systemd service by default.") # Usually when adding such a service, the service name will be provided so we remove it as it's not a log file path - log.remove(name) + if name in log: + log.remove(name) service['log'] = log