LdapClient.update_object(): add relax parameter
This commit is contained in:
parent
3efaceb823
commit
5aa6a0cea4
1 changed files with 3 additions and 2 deletions
|
@ -850,7 +850,7 @@ class LdapClient:
|
||||||
)
|
)
|
||||||
return False
|
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
|
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 changes: The changes to make on LDAP object (as formated by get_changes() method)
|
||||||
:param protected_attrs: An optional list of protected attributes
|
: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: The LDAP object RDN attribute (to detect renaming, default: auto-detected)
|
||||||
|
:param rdn_attr: Enable relax modification server control (optional, default: false)
|
||||||
"""
|
"""
|
||||||
assert (
|
assert (
|
||||||
isinstance(changes, (list, tuple))
|
isinstance(changes, (list, tuple))
|
||||||
|
@ -922,7 +923,7 @@ class LdapClient:
|
||||||
return True
|
return True
|
||||||
assert self._conn or self.initialize()
|
assert self._conn or self.initialize()
|
||||||
return self._conn.update_object(
|
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:
|
except LdapServerException:
|
||||||
log.error(
|
log.error(
|
||||||
|
|
Loading…
Reference in a new issue