From 4db42fdeb7b453bf2d176d69155bcdc4041ed7c5 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Mon, 6 Mar 2017 17:21:40 +0100 Subject: [PATCH] [fix] if a service don't have a 'status' entry, don't list it --- src/yunohost/service.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index c648a0e0e..e64c9cd89 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -201,11 +201,12 @@ def service_status(names=[]): m18n.n('service_unknown', service=name)) status = None - if 'status' not in services[name] or \ - services[name]['status'] == 'service': + if services[name].get('status') == 'service': status = 'service %s status' % name - else: + elif "status" in services[name]: status = str(services[name]['status']) + else: + continue runlevel = 5 if 'runlevel' in services[name].keys():