[mod] call directly python code instead of using os.system

This commit is contained in:
Laurent Peuch 2017-08-13 23:40:44 +02:00
parent 1fe568a60d
commit 968259239d

View file

@ -141,6 +141,7 @@ def domain_remove(auth, domain, force=False):
"""
from yunohost.hook import hook_callback
from yunohost.app import app_ssowatconf
if not force and domain not in domain_list(auth)['domains']:
raise MoulinetteError(errno.EINVAL, m18n.n('domain_unknown'))
@ -167,7 +168,7 @@ def domain_remove(auth, domain, force=False):
raise MoulinetteError(errno.EIO, m18n.n('domain_deletion_failed'))
service_regen_conf(names=['nginx', 'metronome', 'dnsmasq'])
os.system('yunohost app ssowatconf > /dev/null 2>&1')
app_ssowatconf(auth)
hook_callback('post_domain_remove', args=[domain])