From 286449386c366d49b3fae6228a73d2c8e52aca8b Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sun, 13 Aug 2017 23:25:11 +0200 Subject: [PATCH] [mod] clean code, this is what we indeed want to check --- src/yunohost/domain.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index d3884ce46..191a2e79a 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -114,13 +114,10 @@ def domain_add(auth, domain, dyndns=False): if not auth.add('virtualdomain=%s,ou=domains' % domain, attr_dict): raise MoulinetteError(errno.EIO, m18n.n('domain_creation_failed')) - try: - with open('/etc/yunohost/installed', 'r') as f: - service_regen_conf(names=[ - 'nginx', 'metronome', 'dnsmasq', 'rmilter']) - os.system('yunohost app ssowatconf > /dev/null 2>&1') - except IOError: - pass + if os.path.exists('/etc/yunohost/installed'): + service_regen_conf(names=['nginx', 'metronome', 'dnsmasq', 'rmilter']) + os.system('yunohost app ssowatconf > /dev/null 2>&1') + except: # Force domain removal silently try: