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
for service, conf in new_services.items():
# remove service with empty conf
if not conf:
if conf is None:
if service in services:
print("removing '{0}' from services".format(service))
del services[service]

View file

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

View file

@ -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():