summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-01-21 06:43:29 -0500
committerMartin Kosek <mkosek@redhat.com>2013-03-01 16:59:44 +0100
commit8be8d4ebfd876aba109ea133efe11d2386564f3b (patch)
tree2ce30f81c461ae87a8329579704363e2ca48aa06
parent1960945e28e467c18454f27e0839d124473a68cc (diff)
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
-rw-r--r--ipaserver/install/replication.py10
-rw-r--r--ipaserver/ipaldap.py28
2 files changed, 15 insertions, 23 deletions
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index c28fa8902..1555fb993 100644
--- a/ipaserver/install/replication.py
+++ b/ipaserver/install/replication.py
@@ -19,6 +19,7 @@
import time
import sys
+import os
import ldap
@@ -355,12 +356,19 @@ class ReplicationManager(object):
conn.addEntry(entry)
def setup_changelog(self, conn):
+ ent = conn.get_entry(
+ DN(
+ ('cn', 'config'), ('cn', 'ldbm database'),
+ ('cn', 'plugins'), ('cn', 'config')),
+ ['nsslapd-directory'])
+ dbdir = os.path.dirname(ent.getValue('nsslapd-directory'))
+
entry = conn.make_entry(
DN(('cn', 'changelog5'), ('cn', 'config')),
{
'objectclass': ["top", "extensibleobject"],
'cn': ["changelog5"],
- 'nsslapd-changelogdir': [conn.dbdir + "/cldb"],
+ 'nsslapd-changelogdir': [os.path.join(dbdir, "cldb")],
}
)
try:
diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py
index 30c6cfdaa..a84f8fac7 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):