mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
move web config functions to yunohost_domain.py
This commit is contained in:
parent
bf2bfe626e
commit
edd6f7d42e
2 changed files with 14 additions and 2 deletions
|
@ -67,7 +67,19 @@ def domain_add(domains, web=False):
|
||||||
domains = [ domains ]
|
domains = [ domains ]
|
||||||
|
|
||||||
for domain in domains:
|
for domain in domains:
|
||||||
|
try:
|
||||||
yldap.validate_uniqueness({ 'virtualdomain' : domain })
|
yldap.validate_uniqueness({ 'virtualdomain' : domain })
|
||||||
|
except YunoHostError:
|
||||||
|
if web:
|
||||||
|
_apache_config(domain)
|
||||||
|
_lemon_config(domain)
|
||||||
|
|
||||||
|
win_msg(_("Web config created"))
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise YunoHostError(17, _("Domain already created"))
|
||||||
|
|
||||||
|
|
||||||
attr_dict['virtualdomain'] = domain
|
attr_dict['virtualdomain'] = domain
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -109,7 +109,7 @@ def tools_maindomain(old_domain, new_domain):
|
||||||
for line in lines:
|
for line in lines:
|
||||||
sources.write(re.sub(r''+ old_domain +'', new_domain, line))
|
sources.write(re.sub(r''+ old_domain +'', new_domain, line))
|
||||||
|
|
||||||
domain_add([domain], web=True)
|
domain_add([new_domain], web=True)
|
||||||
|
|
||||||
lemon_tmp_conf = '/tmp/tmplemonconf'
|
lemon_tmp_conf = '/tmp/tmplemonconf'
|
||||||
if os.path.exists(lemon_tmp_conf): os.remove(lemon_tmp_conf)
|
if os.path.exists(lemon_tmp_conf): os.remove(lemon_tmp_conf)
|
||||||
|
|
Loading…
Add table
Reference in a new issue