create admin home folder

This commit is contained in:
Kay0u 2020-06-17 22:50:02 +02:00 committed by Alexandre Aubin
parent 1f2061c9ee
commit 509d417070

View file

@ -104,6 +104,14 @@ def tools_ldapinit():
# Force nscd to refresh cache to take admin creation into account
subprocess.call(['nscd', '-i', 'passwd'])
try:
# Attempt to create user home folder
subprocess.check_call(["mkhomedir_helper", "admin"])
except subprocess.CalledProcessError:
if not os.path.isdir('/home/{0}'.format("admin")):
logger.warning(m18n.n('user_home_creation_failed'),
exc_info=1)
# Check admin actually exists now
try:
pwd.getpwnam("admin")