change order of LDAP commands and logging to fix log messages
This commit is contained in:
parent
ceb1016e8f
commit
b0097ea0a5
1 changed files with 2 additions and 2 deletions
|
@ -97,6 +97,8 @@ def create_ldap_user(username, uid, gid, gecos, homedir, shell, password):
|
||||||
if password is not None:
|
if password is not None:
|
||||||
ldapuser.set_password(password)
|
ldapuser.set_password(password)
|
||||||
_LOGGER.info('set password for LDAP user %s', ldapuser.dn)
|
_LOGGER.info('set password for LDAP user %s', ldapuser.dn)
|
||||||
|
ldapuser.save()
|
||||||
|
_LOGGER.info('LDAP user %s created', ldapuser.dn)
|
||||||
if ldapuser.username in ldapgroup.members:
|
if ldapuser.username in ldapgroup.members:
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
'LDAP user %s is already member of LDAP group %s',
|
'LDAP user %s is already member of LDAP group %s',
|
||||||
|
@ -107,8 +109,6 @@ def create_ldap_user(username, uid, gid, gecos, homedir, shell, password):
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
'LDAP user %s has been added to LDAP group %s',
|
'LDAP user %s has been added to LDAP group %s',
|
||||||
ldapuser.dn, ldapgroup.dn)
|
ldapuser.dn, ldapgroup.dn)
|
||||||
ldapuser.save()
|
|
||||||
_LOGGER.info('LDAP user %s created', ldapuser.dn)
|
|
||||||
return ldapuser.dn
|
return ldapuser.dn
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue