From 9f383970b7b1e442c67da5c7180db5918aa502eb Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Fri, 13 May 2016 13:51:44 +0200 Subject: [PATCH] [mod] replace os.system to a direct call to the good funciton --- src/yunohost/domain.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/yunohost/domain.py b/src/yunohost/domain.py index d9beda2f4..b5aee0150 100644 --- a/src/yunohost/domain.py +++ b/src/yunohost/domain.py @@ -37,6 +37,7 @@ from moulinette.utils.log import getActionLogger from yunohost.service import service_regen_conf from yunohost.hook import hook_callback from yunohost.dyndns import dyndns_subscribe +from yunohost.app import app_ssowatconf logger = getActionLogger('yunohost.domain') @@ -154,7 +155,7 @@ def domain_add(auth, domain, dyndns=False): with open('/etc/yunohost/installed', 'r') as f: service_regen_conf(names=[ 'nginx', 'metronome', 'dnsmasq', 'rmilter']) - assert os.system('yunohost app ssowatconf > /dev/null 2>&1') == 0, "SSOwat conf regen failed" + app_ssowatconf(auth) except IOError: pass except: # Force domain removal silently @@ -199,7 +200,7 @@ def domain_remove(auth, domain, force=False): raise MoulinetteError(errno.EIO, m18n.n('domain_deletion_failed')) service_regen_conf(names=['nginx', 'metronome', 'dnsmasq']) - assert os.system('yunohost app ssowatconf > /dev/null 2>&1') == 0, "SSOwat conf regen failed" + app_ssowatconf(auth) hook_callback('post_domain_remove', args=[domain])