From 8be8d4ebfd876aba109ea133efe11d2386564f3b Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 21 Jan 2013 06:43:29 -0500 Subject: Remove dbdir, binddn, bindpwd from IPAdmin The dbdir logic was moved to replication.py, the only caller. The binddn and bindpwd attributes were unused. Part of the work for: https://fedorahosted.org/freeipa/ticket/2660 --- ipaserver/ipaldap.py | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'ipaserver/ipaldap.py') diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py index 30c6cfda..a84f8fac 100644 --- a/ipaserver/ipaldap.py +++ b/ipaserver/ipaldap.py @@ -20,8 +20,6 @@ # import sys -import os -import os.path import string import time import shutil @@ -1567,18 +1565,6 @@ class IPAdmin(LDAPConnection): self.conn = IPASimpleLDAPObject(ldap_uri, force_schema_updates=True) - def __lateinit(self): - """ - This is executed after the connection is bound to fill in some useful - values. - """ - with self.error_handler(): - ent = self.getEntry(DN(('cn', 'config'), ('cn', 'ldbm database'), ('cn', 'plugins'), ('cn', 'config')), - ldap.SCOPE_BASE, '(objectclass=*)', - [ 'nsslapd-directory' ]) - - self.dbdir = os.path.dirname(ent.getValue('nsslapd-directory')) - def __str__(self): return self.host + ":" + str(self.port) @@ -1604,20 +1590,18 @@ class IPAdmin(LDAPConnection): raise e bind_func(*args, **kwargs) - def do_simple_bind(self, binddn=DN(('cn', 'directory manager')), bindpw="", timeout=DEFAULT_TIMEOUT): - self.binddn = binddn # FIXME, self.binddn & self.bindpwd never referenced. - self.bindpwd = bindpw + def do_simple_bind(self, binddn=DN(('cn', 'directory manager')), bindpw="", + timeout=DEFAULT_TIMEOUT): self.__bind_with_wait(self.simple_bind_s, timeout, binddn, bindpw) - self.__lateinit() def do_sasl_gssapi_bind(self, timeout=DEFAULT_TIMEOUT): - self.__bind_with_wait(self.sasl_interactive_bind_s, timeout, None, SASL_AUTH) - self.__lateinit() + self.__bind_with_wait( + self.sasl_interactive_bind_s, timeout, None, SASL_AUTH) def do_external_bind(self, user_name=None, timeout=DEFAULT_TIMEOUT): auth_tokens = ldap.sasl.external(user_name) - self.__bind_with_wait(self.sasl_interactive_bind_s, timeout, None, auth_tokens) - self.__lateinit() + self.__bind_with_wait( + self.sasl_interactive_bind_s, timeout, None, auth_tokens) def getEntry(self, base, scope, filterstr='(objectClass=*)', attrlist=None): -- cgit