mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Let's create the home after we validate that admin actually does exists
This commit is contained in:
parent
509d417070
commit
c2422d8c3e
1 changed files with 8 additions and 8 deletions
|
@ -104,6 +104,13 @@ def tools_ldapinit():
|
||||||
# Force nscd to refresh cache to take admin creation into account
|
# Force nscd to refresh cache to take admin creation into account
|
||||||
subprocess.call(['nscd', '-i', 'passwd'])
|
subprocess.call(['nscd', '-i', 'passwd'])
|
||||||
|
|
||||||
|
# Check admin actually exists now
|
||||||
|
try:
|
||||||
|
pwd.getpwnam("admin")
|
||||||
|
except KeyError:
|
||||||
|
logger.error(m18n.n('ldap_init_failed_to_create_admin'))
|
||||||
|
raise YunohostError('installation_failed')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Attempt to create user home folder
|
# Attempt to create user home folder
|
||||||
subprocess.check_call(["mkhomedir_helper", "admin"])
|
subprocess.check_call(["mkhomedir_helper", "admin"])
|
||||||
|
@ -112,13 +119,6 @@ def tools_ldapinit():
|
||||||
logger.warning(m18n.n('user_home_creation_failed'),
|
logger.warning(m18n.n('user_home_creation_failed'),
|
||||||
exc_info=1)
|
exc_info=1)
|
||||||
|
|
||||||
# Check admin actually exists now
|
|
||||||
try:
|
|
||||||
pwd.getpwnam("admin")
|
|
||||||
except KeyError:
|
|
||||||
logger.error(m18n.n('ldap_init_failed_to_create_admin'))
|
|
||||||
raise YunohostError('installation_failed')
|
|
||||||
|
|
||||||
logger.success(m18n.n('ldap_initialized'))
|
logger.success(m18n.n('ldap_initialized'))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue