From 8c46e978a3f0c9845e3734cf3d10c0d8e8fbd705 Mon Sep 17 00:00:00 2001 From: kload Date: Thu, 1 Oct 2015 19:23:37 -0400 Subject: [PATCH] [fix] Regenerate configuration files only if YunoHost is postinstalled --- data/templates/slapd/slapd.conf | 1 - lib/yunohost/domain.py | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/data/templates/slapd/slapd.conf b/data/templates/slapd/slapd.conf index e5ac88014..f47e6761b 100644 --- a/data/templates/slapd/slapd.conf +++ b/data/templates/slapd/slapd.conf @@ -14,7 +14,6 @@ include /etc/ldap/schema/nis.schema include /etc/ldap/schema/inetorgperson.schema include /etc/ldap/schema/mailserver.schema include /etc/ldap/schema/sudo.schema -include /etc/ldap/schema/samba.schema # Where the pid file is put. The init.d script # will not stop the server if you change this. diff --git a/lib/yunohost/domain.py b/lib/yunohost/domain.py index 434e97e4a..9d3d3f743 100644 --- a/lib/yunohost/domain.py +++ b/lib/yunohost/domain.py @@ -159,10 +159,13 @@ 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')) - service_regenconf(service='nginx') - service_regenconf(service='metronome') - service_regenconf(service='dnsmasq') - os.system('yunohost app ssowatconf > /dev/null 2>&1') + try: + with open('/etc/yunohost/installed', 'r') as f: + service_regenconf(service='nginx') + service_regenconf(service='metronome') + service_regenconf(service='dnsmasq') + os.system('yunohost app ssowatconf > /dev/null 2>&1') + except IOError: pass except: # Force domain removal silently try: domain_remove(auth, domain, True)