ldap.LdapClient: fix errors handling changes on RDN attribute
This commit is contained in:
parent
947ed765aa
commit
26e7b8efd1
1 changed files with 4 additions and 4 deletions
|
@ -722,9 +722,9 @@ class LdapClient:
|
|||
)
|
||||
|
||||
# Compute new object DN
|
||||
dn_parts = ldap_obj['dn'].split(',')
|
||||
dn_parts = self.decode(ldap_obj['dn']).split(',')
|
||||
basedn = ','.join(dn_parts[1:])
|
||||
new_rdn = '%s=%s' % (rdn_attr, new_rdn_values[0])
|
||||
new_rdn = '%s=%s' % (rdn_attr, self.decode(new_rdn_values[0]))
|
||||
new_dn = '%s,%s' % (new_rdn, basedn)
|
||||
|
||||
# Rename object
|
||||
|
@ -733,10 +733,10 @@ class LdapClient:
|
|||
return False
|
||||
|
||||
# Remove RDN in changes list
|
||||
for attr in changes[0].keys():
|
||||
for attr in list(changes[0].keys()):
|
||||
if attr.lower() == rdn_attr.lower():
|
||||
del changes[0][attr]
|
||||
for attr in changes[1].keys():
|
||||
for attr in list(changes[1].keys()):
|
||||
if attr.lower() == rdn_attr.lower():
|
||||
del changes[1][attr]
|
||||
|
||||
|
|
Loading…
Reference in a new issue