From 5aa6a0cea4300195afe97b6dc2f997b64883d920 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 13 Mar 2023 17:02:52 +0100 Subject: [PATCH] LdapClient.update_object(): add relax parameter --- mylib/ldap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mylib/ldap.py b/mylib/ldap.py index 924252f..fbdd0ca 100644 --- a/mylib/ldap.py +++ b/mylib/ldap.py @@ -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(