Merge pull request #220 from YunoHost/conf-hashes-logs

[mod] Cleaner _get_conf_hashes logs
This commit is contained in:
Laurent Peuch 2017-02-03 14:55:49 +01:00 committed by GitHub
commit 5be13fd07e

View file

@ -639,12 +639,17 @@ def _get_pending_conf(services=[]):
def _get_conf_hashes(service): def _get_conf_hashes(service):
"""Get the registered conf hashes for a service""" """Get the registered conf hashes for a service"""
try:
return _get_services()[service]['conffiles'] services = _get_services()
except:
logger.debug("unable to retrieve conf hashes for %s", if service not in services:
service, exc_info=1) logger.debug("Service %s is not in services.yml yet.", service)
return {} return {}
elif 'conffiles' not in services[service]:
logger.debug("No configuration files for service %s.", service)
return {}
else:
return services[service]['conffiles']
def _update_conf_hashes(service, hashes): def _update_conf_hashes(service, hashes):