]> Frank Brehm's Git Trees - pixelpark/ldap-migration.git/commitdiff
Bugfixing
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 19 Nov 2020 11:53:05 +0000 (12:53 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 19 Nov 2020 11:53:05 +0000 (12:53 +0100)
lib/ldap_migration/__init__.py
lib/ldap_migration/idict.py

index 79e6575da2eaf045d053c57373390b6e6c18b261..85f8f299abe768666cc052e9755697e29e1421db 100644 (file)
@@ -37,7 +37,7 @@ from fb_tools.errors import FbAppError
 from .config import LDAPMigrationConfiguration
 from .idict import CaseInsensitiveDict
 
-__version__ = '0.6.5'
+__version__ = '0.6.6'
 
 LOG = logging.getLogger(__name__)
 CFG_BASENAME = 'ldap-migration.ini'
@@ -983,8 +983,10 @@ class LDAPMigrationApplication(BaseApplication):
                 src_attrs = ['aci', ALL_ATTRIBUTES]
             tgt_attrs = [ALL_ATTRIBUTES]
 
+            tgt_dn = self.mangle_dn(src_dn)
+
             src_status, src_result, src_response, _ = self.source.search(
-                search_base=src_dn, search_scope=BASE, search_filter=sfilter,
+                search_base=tgt_dn, search_scope=BASE, search_filter=sfilter,
                 get_operational_attributes=True, attributes=src_attrs,
                 time_limit=self.config.timeout)
 
@@ -999,7 +1001,6 @@ class LDAPMigrationApplication(BaseApplication):
                     LOG.debug("Response of searching for source DN {dn!r}:\n{res}".format(
                         dn=src_dn, res=pp(src_entry)))
 
-                tgt_dn = self.mangle_dn(src_dn)
                 if self.verbose > 1:
                     LOG.debug("Searching for target DN {dn!r}.".format(dn=tgt_dn))
                 tgt_status, tgt_result, tgt_response, _ = self.target.search(
index 37b2ee5e4278ca8c39cca8008fc77c706bb8ad07..a1a0e75d632fad6b78128288ea223ef8f1229908 100644 (file)
@@ -24,7 +24,7 @@ from fb_tools.common import pp
 from fb_tools.errors import FbError
 from fb_tools.obj import FbBaseObject
 
-__version__ = '0.1.4'
+__version__ = '0.1.5'
 
 LOG = logging.getLogger(__name__)
 
@@ -41,7 +41,7 @@ class WrongKeyTypeError(TypeError, FbError):
     def __str__(self):
 
         msg = "Key {key!r} must be of type 'str', but is of type {cls!r} instead."
-        return msg.format(key=key, cls=key.__class__.__name__)
+        return msg.format(key=self.key, cls=self.key.__class__.__name__)
 
 
 # =============================================================================