mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Remove IPAdmin.unbind_s(), keep unbind()
The unbind and unbind_s functions do the same thing (both are synchronous). In the low-level IPASimpleLDAPObject, unbind_s rather than unbind is kept. Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
This commit is contained in:
committed by
Martin Kosek
parent
f7a4cceb97
commit
334a0cdcdc
@@ -224,7 +224,7 @@ def list_replicas(realm, host, replica, dirman_passwd, verbose):
|
||||
except Exception, e:
|
||||
sys.exit("Failed to get data from '%s' while trying to list replicas: %s" % (host, convert_error(e)))
|
||||
finally:
|
||||
conn.unbind_s()
|
||||
conn.unbind()
|
||||
|
||||
if not replica:
|
||||
for k, p in peers.iteritems():
|
||||
@@ -395,7 +395,7 @@ def add_link(realm, replica1, replica2, dirman_passwd, options):
|
||||
dn = DN(('cn', 'CA'), ('cn', replica2), ('cn', 'masters'), ('cn', 'ipa'), ('cn', 'etc'),
|
||||
ipautil.realm_to_suffix(realm))
|
||||
conn.get_entries(dn, ldap.SCOPE_ONELEVEL)
|
||||
conn.unbind_s()
|
||||
conn.unbind()
|
||||
except errors.NotFound:
|
||||
sys.exit('%s does not have a CA configured.' % replica2)
|
||||
except errors.NetworkError, e:
|
||||
|
||||
@@ -616,7 +616,7 @@ def main():
|
||||
if conn and conn.isconnected():
|
||||
conn.disconnect()
|
||||
if replman and replman.conn:
|
||||
replman.conn.unbind_s()
|
||||
replman.conn.unbind()
|
||||
|
||||
if options.skip_schema_check:
|
||||
root_logger.info("Skipping CA DS schema check")
|
||||
|
||||
@@ -190,7 +190,7 @@ def dns_container_exists(fqdn, suffix, dm_password=None, ldapi=False, realm=None
|
||||
raise RuntimeError('LDAP server on %s is not responding. Is IPA installed?' % fqdn)
|
||||
|
||||
ret = object_exists(DN(('cn', 'dns'), suffix))
|
||||
conn.unbind_s()
|
||||
conn.unbind()
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
@@ -1084,7 +1084,7 @@ class CAInstance(service.Service):
|
||||
modlist = [(0, 'uniqueMember', '%s' % entry_dn)]
|
||||
conn.modify_s(dn, modlist)
|
||||
|
||||
conn.unbind_s()
|
||||
conn.unbind()
|
||||
|
||||
def __run_certutil(self, args, database=None, pwd_file=None,stdin=None):
|
||||
if not database:
|
||||
|
||||
@@ -570,10 +570,6 @@ class IPASimpleLDAPObject(object):
|
||||
def start_tls_s(self):
|
||||
return self.conn.start_tls_s()
|
||||
|
||||
def unbind(self):
|
||||
self.flush_cached_schema()
|
||||
return self.conn.unbind()
|
||||
|
||||
def unbind_s(self):
|
||||
self.flush_cached_schema()
|
||||
return self.conn.unbind_s()
|
||||
@@ -1704,10 +1700,6 @@ class IPAdmin(LDAPClient):
|
||||
# FIXME: for backwards compatibility only
|
||||
return self.conn.modify_s(*args, **kwargs)
|
||||
|
||||
def unbind_s(self, *args, **kwargs):
|
||||
# FIXME: for backwards compatibility only
|
||||
return self.conn.unbind_s(*args, **kwargs)
|
||||
|
||||
def set_option(self, *args, **kwargs):
|
||||
# FIXME: for backwards compatibility only
|
||||
return self.conn.set_option(*args, **kwargs)
|
||||
@@ -1717,8 +1709,7 @@ class IPAdmin(LDAPClient):
|
||||
return self.conn.encode(*args, **kwargs)
|
||||
|
||||
def unbind(self, *args, **kwargs):
|
||||
# FIXME: for backwards compatibility only
|
||||
return self.conn.unbind(*args, **kwargs)
|
||||
return self.conn.unbind_s(*args, **kwargs)
|
||||
|
||||
|
||||
# FIXME: Some installer tools depend on ipaldap importing plugins.ldap2.
|
||||
|
||||
@@ -347,7 +347,7 @@ class ldap2(LDAPClient, CrudBackend):
|
||||
conn = IPASimpleLDAPObject(
|
||||
self.ldap_uri, force_schema_updates=False)
|
||||
conn.simple_bind_s(dn, old_pass)
|
||||
conn.unbind()
|
||||
conn.unbind_s()
|
||||
|
||||
with self.error_handler():
|
||||
self.conn.passwd_s(dn, old_pass, new_pass)
|
||||
|
||||
Reference in New Issue
Block a user