]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Fixing lib/pp_admintools/app/ldap.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 11 Jan 2023 15:34:44 +0000 (16:34 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 11 Jan 2023 15:34:44 +0000 (16:34 +0100)
lib/pp_admintools/app/ldap.py

index 299909fb1186b8bc1c6b311c6bb897420eb482c1..d19ef19278442b05447299bbf99fbf392731fe15 100644 (file)
@@ -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
 
     # -------------------------------------------------------------------------