Fix handling of old services with empty log_type

This commit is contained in:
Alexandre Aubin 2019-01-26 23:32:07 +01:00
parent bbb004e056
commit e379f4e3db

View file

@ -383,7 +383,12 @@ def service_log(name, number=50):
raise YunohostError('service_no_log', service=name) raise YunohostError('service_no_log', service=name)
log_list = services[name]['log'] log_list = services[name]['log']
log_type_list = services[name]['log_type'] log_type_list = services[name].get('log_type', [])
if not isinstance(log_list, list):
log_list = [log_list]
if len(log_type_list) < len(log_list):
log_type_list.extend(["file"] * (len(log_list)-len(log_type_list)))
result = {} result = {}