Merge pull request #269 from YunoHost/clean-services.yml

Clean services.yml
This commit is contained in:
Laurent Peuch 2017-03-20 01:50:09 +01:00 committed by GitHub
commit 373ef1acba
3 changed files with 11 additions and 8 deletions

View file

@ -65,7 +65,7 @@ with open('/etc/yunohost/services.yml') as f:
updated = False updated = False
for service, conf in new_services.items(): for service, conf in new_services.items():
# remove service with empty conf # remove service with empty conf
if not conf: if conf is None:
if service in services: if service in services:
print("removing '{0}' from services".format(service)) print("removing '{0}' from services".format(service))
del services[service] del services[service]

View file

@ -50,10 +50,12 @@ yunohost-firewall:
nslcd: nslcd:
status: service status: service
log: /var/log/syslog log: /var/log/syslog
nsswitch: nsswitch: {}
status: service bind9: null
udisks2: tahoe-lafs: null
status: service memcached: null
udisks2: null
udisk-glue: null
amavis: null amavis: null
postgrey: null postgrey: null
spamassassin: null spamassassin: null

View file

@ -201,11 +201,12 @@ def service_status(names=[]):
m18n.n('service_unknown', service=name)) m18n.n('service_unknown', service=name))
status = None status = None
if 'status' not in services[name] or \ if services[name].get('status') == 'service':
services[name]['status'] == 'service':
status = 'service %s status' % name status = 'service %s status' % name
else: elif "status" in services[name]:
status = str(services[name]['status']) status = str(services[name]['status'])
else:
continue
runlevel = 5 runlevel = 5
if 'runlevel' in services[name].keys(): if 'runlevel' in services[name].keys():