Reflect change in openldap if any attribute of tryton changed

Hello, I am trying to modify the openldap’s attributes value, if any field of tryton get change like login name, login of user, etc…

For now I trying to do it via hardcode the attribute to be change.

Code:

from ldap3 import MODIFY_ADD, MODIFY_REPLACE, MODIFY_DELETE

server = ldap_server()
if server:
    con = ldap3.Connection(server, dn, password)
    if (password and con.bind()):

        result = con.modify('uid=testopenldap1,ou=user,dc=example,dc=com',
                            {'givenName': [(MODIFY_REPLACE, ['givenname-1-replaced'])],
                             'sn': [(MODIFY_REPLACE, ['sn-replaced'])]})
       print(result)

Output: False

Can someone guide me how to modification can be done in openldap ?

I would suggest to activate the logging to see what is happening: https://ldap3.readthedocs.io/logging.html
Or ask for support to the ldap3 community: https://ldap3.readthedocs.io/welcome.html#support