mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] style, declare everything as once to make code more readable
This commit is contained in:
parent
555caa9c73
commit
1fe568a60d
1 changed files with 4 additions and 3 deletions
|
@ -74,8 +74,6 @@ def domain_add(auth, domain, dyndns=False):
|
||||||
"""
|
"""
|
||||||
from yunohost.hook import hook_callback
|
from yunohost.hook import hook_callback
|
||||||
|
|
||||||
attr_dict = {'objectClass': ['mailDomain', 'top']}
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
auth.validate_uniqueness({'virtualdomain': domain})
|
auth.validate_uniqueness({'virtualdomain': domain})
|
||||||
except MoulinetteError:
|
except MoulinetteError:
|
||||||
|
@ -108,7 +106,10 @@ def domain_add(auth, domain, dyndns=False):
|
||||||
try:
|
try:
|
||||||
yunohost.certificate._certificate_install_selfsigned([domain], False)
|
yunohost.certificate._certificate_install_selfsigned([domain], False)
|
||||||
|
|
||||||
attr_dict['virtualdomain'] = domain
|
attr_dict = {
|
||||||
|
'objectClass': ['mailDomain', 'top'],
|
||||||
|
'virtualdomain': domain,
|
||||||
|
}
|
||||||
|
|
||||||
if not auth.add('virtualdomain=%s,ou=domains' % domain, attr_dict):
|
if not auth.add('virtualdomain=%s,ou=domains' % domain, attr_dict):
|
||||||
raise MoulinetteError(errno.EIO, m18n.n('domain_creation_failed'))
|
raise MoulinetteError(errno.EIO, m18n.n('domain_creation_failed'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue