summaryrefslogtreecommitdiffstats
path: root/ipaserver/ipaldap.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-01-23 10:05:21 -0500
committerMartin Kosek <mkosek@redhat.com>2013-03-01 16:59:45 +0100
commit5184c312f6dd1a885c9e0e10e3763eddb8110bae (patch)
treeb80d94b6fb94cb842aca6d65cc6f6be14b0ae5f0 /ipaserver/ipaldap.py
parentd17f9020a847c7a6db7734f1525c59efe07fbdcd (diff)
downloadfreeipa-5184c312f6dd1a885c9e0e10e3763eddb8110bae.tar.gz
freeipa-5184c312f6dd1a885c9e0e10e3763eddb8110bae.tar.xz
freeipa-5184c312f6dd1a885c9e0e10e3763eddb8110bae.zip
replace getEntry with get_entry (or get_entries if scope != SCOPE_BASE)
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
Diffstat (limited to 'ipaserver/ipaldap.py')
-rw-r--r--ipaserver/ipaldap.py21
1 files changed, 5 insertions, 16 deletions
diff --git a/ipaserver/ipaldap.py b/ipaserver/ipaldap.py
index 00dff18f6..b4d0a5d9a 100644
--- a/ipaserver/ipaldap.py
+++ b/ipaserver/ipaldap.py
@@ -1621,17 +1621,6 @@ class IPAdmin(LDAPClient):
self.__bind_with_wait(
self.sasl_interactive_bind_s, timeout, None, auth_tokens)
- def getEntry(self, base, scope, filterstr='(objectClass=*)',
- attrlist=None):
- # FIXME: for backwards compatibility only
- result, truncated = self.find_entries(
- filter=filterstr,
- attrs_list=attrlist,
- base_dn=base,
- scope=scope,
- )
- return result[0]
-
def updateEntry(self,dn,oldentry,newentry):
# FIXME: for backwards compatibility only
"""This wraps the mod function. It assumes that the entry is already
@@ -1728,7 +1717,6 @@ class IPAdmin(LDAPClient):
return True
def waitForEntry(self, dn, timeout=7200, attr='', quiet=True):
- scope = ldap.SCOPE_BASE
filter = "(objectclass=*)"
attrlist = []
if attr:
@@ -1747,10 +1735,11 @@ class IPAdmin(LDAPClient):
entry = None
while not entry and int(time.time()) < timeout:
try:
- entry = self.getEntry(dn, scope, filter, attrlist)
- except ldap.NO_SUCH_OBJECT:
- pass # no entry yet
- except ldap.LDAPError, e: # badness
+ [entry] = self.get_entries(
+ dn, ldap.SCOPE_BASE, filter, attrlist)
+ except errors.NotFound:
+ pass # no entry yet
+ except Exception, e: # badness
print "\nError reading entry", dn, e
break
if not entry: