From: Frank Brehm Date: Fri, 30 Sep 2022 14:47:37 +0000 (+0200) Subject: Adding possibility to give a separate LDAP connection X-Git-Tag: 0.6.0^2~1^2~7 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=f588b19ad3c16b98650289145e1ad06baad45de6;p=pixelpark%2Fpp-admin-tools.git Adding possibility to give a separate LDAP connection --- diff --git a/lib/pp_admintools/app/ldap.py b/lib/pp_admintools/app/ldap.py index d57d922..e313175 100644 --- a/lib/pp_admintools/app/ldap.py +++ b/lib/pp_admintools/app/ldap.py @@ -50,7 +50,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.7.3' +__version__ = '0.7.4' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -991,10 +991,11 @@ class BaseLdapApplication(BaseDPXApplication): return attribs # ------------------------------------------------------------------------- - def modify_entry(self, inst, dn, changes): + def modify_entry(self, inst, dn, changes, ldap=None): connect_info = self.cfg.ldap_connection[inst] - ldap = self.ldap_connection[inst] + if not ldap: + ldap = self.ldap_connection[inst] # connect_info = self.cfg.ldap_connection[inst] if self.verbose > 1: @@ -1035,10 +1036,11 @@ class BaseLdapApplication(BaseDPXApplication): return True # ------------------------------------------------------------------------- - def delete_entry(self, inst, dn): + def delete_entry(self, inst, dn, ldap=None): connect_info = self.cfg.ldap_connection[inst] - ldap = self.ldap_connection[inst] + if not ldap: + ldap = self.ldap_connection[inst] msg = _("Deleting LDAP entry {dn!r} on {uri} ...").format( uri=connect_info.url, dn=dn)