From 85f1802ec9a2444e305c374bdb937cc39646b664 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 22 May 2020 21:05:19 +0200 Subject: [PATCH] [fix] empty services.yml file --- data/hooks/conf_regen/01-yunohost | 2 +- src/yunohost/service.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/hooks/conf_regen/01-yunohost b/data/hooks/conf_regen/01-yunohost index 4bd763b70..02f191c29 100755 --- a/data/hooks/conf_regen/01-yunohost +++ b/data/hooks/conf_regen/01-yunohost @@ -98,7 +98,7 @@ with open('services.yml') as f: new_services = yaml.load(f) with open('/etc/yunohost/services.yml') as f: - services = yaml.load(f) + services = yaml.load(f) or {} updated = False diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 1f77e3545..91edeb2e6 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -586,7 +586,7 @@ def _get_services(): """ try: with open('/etc/yunohost/services.yml', 'r') as f: - services = yaml.load(f) + services = yaml.load(f) or {} except: return {}