Use app_ssowatconf instead of os.system call

This commit is contained in:
Alexandre Aubin 2017-08-19 11:11:49 -04:00
parent 968259239d
commit 360ac66bc7

View file

@ -73,6 +73,7 @@ def domain_add(auth, domain, dyndns=False):
"""
from yunohost.hook import hook_callback
from yunohost.app import app_ssowatconf
try:
auth.validate_uniqueness({'virtualdomain': domain})
@ -114,9 +115,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'))
# Don't regen these conf if we're still in postinstall
if os.path.exists('/etc/yunohost/installed'):
service_regen_conf(names=['nginx', 'metronome', 'dnsmasq', 'rmilter'])
os.system('yunohost app ssowatconf > /dev/null 2>&1')
app_ssowatconf(auth)
except:
# Force domain removal silently