summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-01-28 12:12:04 -0500
committerMartin Kosek <mkosek@redhat.com>2013-03-01 16:59:46 +0100
commitf9f6cd6e3a907f3bb205f5121727f4f94acfeaef (patch)
tree1b4aa321eafcef4b73ca11f3ba1b112a3d19f9b7
parent8f44811a9570e2a0dbc821b6ca48748a5d6eace7 (diff)
downloadfreeipa-f9f6cd6e3a907f3bb205f5121727f4f94acfeaef.tar.gz
freeipa-f9f6cd6e3a907f3bb205f5121727f4f94acfeaef.tar.xz
freeipa-f9f6cd6e3a907f3bb205f5121727f4f94acfeaef.zip
Replace IPAdmin.start_tls_s by an __init__ argument
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
-rw-r--r--ipaserver/install/replication.py12
-rw-r--r--ipaserver/ipaldap.py10
2 files changed, 11 insertions, 11 deletions
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py
index d97c5bdb6..804d046bf 100644
--- a/ipaserver/install/replication.py
+++ b/ipaserver/install/replication.py
@@ -189,9 +189,9 @@ class ReplicationManager(object):
# If we are passed a password we'll use it as the DM password
# otherwise we'll do a GSSAPI bind.
if starttls:
- self.conn = ipaldap.IPAdmin(hostname, port=port, cacert=CACERT,
- protocol='ldap')
- self.conn.start_tls_s()
+ self.conn = ipaldap.IPAdmin(
+ hostname, port=port, cacert=CACERT, protocol='ldap',
+ start_tls=True)
else:
self.conn = ipaldap.IPAdmin(hostname, port=port, cacert=CACERT)
if dirman_passwd:
@@ -917,9 +917,9 @@ class ReplicationManager(object):
local_port = r_port
# note - there appears to be a bug in python-ldap - it does not
# allow connections using two different CA certs
- r_conn = ipaldap.IPAdmin(r_hostname, port=r_port, cacert=CACERT,
- protocol='ldap')
- r_conn.start_tls_s()
+ r_conn = ipaldap.IPAdmin(
+ r_hostname, port=r_port, cacert=CACERT, protocol='ldap',
+ start_tls=True)
if r_bindpw:
r_conn.do_simple_bind(binddn=r_binddn, bindpw=r_bindpw)
diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py
index 9e1266bf5..5fed6f3ac 100644
--- a/ipaserver/ipaldap.py
+++ b/ipaserver/ipaldap.py
@@ -1561,7 +1561,8 @@ class IPAdmin(LDAPClient):
return 'ldap'
def __init__(self, host='', port=389, cacert=None, debug=None, ldapi=False,
- realm=None, protocol=None, force_schema_updates=True):
+ realm=None, protocol=None, force_schema_updates=True,
+ start_tls=False):
self.conn = None
log_mgr.get_logger(self, True)
if debug and debug.lower() == "on":
@@ -1582,6 +1583,9 @@ class IPAdmin(LDAPClient):
self.conn = IPASimpleLDAPObject(ldap_uri, force_schema_updates=True)
+ if start_tls:
+ self.conn.start_tls_s()
+
def __str__(self):
return self.host + ":" + str(self.port)
@@ -1724,10 +1728,6 @@ class IPAdmin(LDAPClient):
# FIXME: for backwards compatibility only
return self.conn.unbind(*args, **kwargs)
- def start_tls_s(self, *args, **kwargs):
- # FIXME: for backwards compatibility only
- return self.conn.start_tls_s(*args, **kwargs)
-
# FIXME: Some installer tools depend on ipaldap importing plugins.ldap2.
# The proper plugins should rather be imported explicitly.