[fix] Instantiate authenticator for a yolo postinstall

This commit is contained in:
Jérôme Lebleu 2014-05-16 18:48:40 +02:00
parent 1edfc50c7f
commit b0ad058e6d

View file

@ -188,6 +188,8 @@ def tools_postinstall(domain, password, dyndns=False):
password -- YunoHost admin password
"""
from moulinette.core import init_authenticator
from yunohost.backup import backup_init
from yunohost.app import app_ssowatconf
@ -261,6 +263,13 @@ def tools_postinstall(domain, password, dyndns=False):
raise MoulinetteError(errno.EPERM,
m18n.n('yunohost_ca_creation_failed'))
# Instantiate LDAP Authenticator
auth = init_authenticator(('ldap', 'default'),
{ 'uri': "ldap://localhost:389",
'base_dn': "dc=yunohost,dc=org",
'user_rdn': "cn=admin" })
auth.authenticate('yunohost')
# Initialize YunoHost LDAP base
tools_ldapinit(auth)