From: Frank Brehm Date: Wed, 11 Jan 2023 15:34:44 +0000 (+0100) Subject: Fixing lib/pp_admintools/app/ldap.py X-Git-Tag: 0.8.0^2~3 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=c3886aab0712260320459df89d17de69804dd009;p=pixelpark%2Fpp-admin-tools.git Fixing lib/pp_admintools/app/ldap.py --- diff --git a/lib/pp_admintools/app/ldap.py b/lib/pp_admintools/app/ldap.py index 299909f..d19ef19 100644 --- a/lib/pp_admintools/app/ldap.py +++ b/lib/pp_admintools/app/ldap.py @@ -54,7 +54,7 @@ from ..config.ldap import LdapConnectionInfo, LdapConfiguration # rom ..config.ldap import DEFAULT_PORT_LDAP, DEFAULT_PORT_LDAPS from ..config.ldap import DEFAULT_TIMEOUT -__version__ = '0.11.0' +__version__ = '0.11.1' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -1555,7 +1555,7 @@ class BaseLdapApplication(BaseDPXApplication): msg = _("Values to removed from attribute {!r}:").format(attrib_name) LOG.debug(msg + '\n' + pp(values_del)) - if len(values_add) == len(src_attrib_values): + if len(values_add) == len(src_attrib_values) and len(values_del) == 0: if len(values_add): attr_changes.append((MODIFY_REPLACE, values_add)) else: @@ -1567,6 +1567,14 @@ class BaseLdapApplication(BaseDPXApplication): else: attr_changes = [(MODIFY_ADD, src_attrib_values)] + if self.verbose > 3: + if attr_changes: + msg = _("Changes for attribute {!r}:").format(attrib_name) + msg += '\n' + pp(attr_changes) + else: + msg = _("No changes to attribute {!r}.").format(attrib_name) + LOG.debug(msg) + return attr_changes # -------------------------------------------------------------------------