LdapClient.update_object(): add relax parameter

This commit is contained in:
Benjamin Renard 2023-03-13 17:02:52 +01:00
parent 3efaceb823
commit 5aa6a0cea4
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -850,7 +850,7 @@ class LdapClient:
)
return False
def update_object(self, ldap_obj, changes, protected_attrs=None, rdn_attr=None):
def update_object(self, ldap_obj, changes, protected_attrs=None, rdn_attr=None, relax=False):
"""
Update an object
@ -858,6 +858,7 @@ class LdapClient:
:param changes: The changes to make on LDAP object (as formated by get_changes() method)
:param protected_attrs: An optional list of protected attributes
:param rdn_attr: The LDAP object RDN attribute (to detect renaming, default: auto-detected)
:param rdn_attr: Enable relax modification server control (optional, default: false)
"""
assert (
isinstance(changes, (list, tuple))
@ -922,7 +923,7 @@ class LdapClient:
return True
assert self._conn or self.initialize()
return self._conn.update_object(
ldap_obj["dn"], _changes[0], _changes[1], ignore_attrs=protected_attrs
ldap_obj["dn"], _changes[0], _changes[1], ignore_attrs=protected_attrs, relax=relax
)
except LdapServerException:
log.error(