mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] Call regen-conf only once passing a list in domain_add/remove
This commit is contained in:
parent
55f4ff8d69
commit
55debefd56
1 changed files with 5 additions and 9 deletions
|
@ -37,6 +37,8 @@ from urllib import urlopen
|
|||
from moulinette.core import MoulinetteError
|
||||
from moulinette.utils.log import getActionLogger
|
||||
|
||||
from yunohost.service import service_regen_conf
|
||||
|
||||
logger = getActionLogger('yunohost.domain')
|
||||
|
||||
|
||||
|
@ -78,7 +80,6 @@ def domain_add(auth, domain, dyndns=False):
|
|||
dyndns -- Subscribe to DynDNS
|
||||
|
||||
"""
|
||||
from yunohost.service import service_regen_conf
|
||||
from yunohost.hook import hook_callback
|
||||
|
||||
attr_dict = { 'objectClass' : ['mailDomain', 'top'] }
|
||||
|
@ -157,10 +158,8 @@ def domain_add(auth, domain, dyndns=False):
|
|||
|
||||
try:
|
||||
with open('/etc/yunohost/installed', 'r') as f:
|
||||
service_regen_conf(names='nginx')
|
||||
service_regen_conf(names='metronome')
|
||||
service_regen_conf(names='dnsmasq')
|
||||
service_regen_conf(names='rmilter')
|
||||
service_regen_conf(names=[
|
||||
'nginx', 'metronome', 'dnsmasq', 'rmilter'])
|
||||
os.system('yunohost app ssowatconf > /dev/null 2>&1')
|
||||
except IOError: pass
|
||||
except:
|
||||
|
@ -183,7 +182,6 @@ def domain_remove(auth, domain, force=False):
|
|||
force -- Force the domain removal
|
||||
|
||||
"""
|
||||
from yunohost.service import service_regen_conf
|
||||
from yunohost.hook import hook_callback
|
||||
|
||||
if not force and domain not in domain_list(auth)['domains']:
|
||||
|
@ -206,9 +204,7 @@ def domain_remove(auth, domain, force=False):
|
|||
else:
|
||||
raise MoulinetteError(errno.EIO, m18n.n('domain_deletion_failed'))
|
||||
|
||||
service_regen_conf(names='nginx')
|
||||
service_regen_conf(names='metronome')
|
||||
service_regen_conf(names='dnsmasq')
|
||||
service_regen_conf(names=['nginx', 'metronome', 'dnsmasq'])
|
||||
os.system('yunohost app ssowatconf > /dev/null 2>&1')
|
||||
|
||||
hook_callback('post_domain_remove', args=[domain])
|
||||
|
|
Loading…
Add table
Reference in a new issue