summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-04-17 09:56:04 +0200
committerRob Crittenden <rcritten@redhat.com>2012-04-16 23:23:57 -0400
commita663e83cb2717ac4cf831261c93c1582f562a07f (patch)
tree0aa48c58231c340c5eb3a0eab5e76ffbe925422c /ipalib
parentadf16a9b1c52ea8ee1e9989b99ab7da32adddf38 (diff)
downloadfreeipa-a663e83cb2717ac4cf831261c93c1582f562a07f.tar.gz
freeipa-a663e83cb2717ac4cf831261c93c1582f562a07f.tar.xz
freeipa-a663e83cb2717ac4cf831261c93c1582f562a07f.zip
Raise proper exception when LDAP limits are exceeded
ldap2 plugin returns NotFound error for find_entries/get_entry queries when the server did not manage to return an entry due to time limits. This may be confusing for user when the entry he searches actually exists. This patch fixes the behavior in ldap2 plugin to 1) Return even a zero search results + truncated bool set in ldap2.find_entries 2) Raise LimitsExceeded in ldap2.get_entry and ldap2.find_entry_by_attr instead of NotFound error This changed several assumptions about ldap2.find_entries results. Several calls accross IPA code base had to be amended. https://fedorahosted.org/freeipa/ticket/2606
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/automount.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ipalib/plugins/automount.py b/ipalib/plugins/automount.py
index 9df400d2e..366729425 100644
--- a/ipalib/plugins/automount.py
+++ b/ipalib/plugins/automount.py
@@ -724,6 +724,8 @@ class automountkey(LDAPObject):
basedn, _ldap.SCOPE_ONELEVEL)
if len(entries) > 1:
raise errors.NotFound(reason=_('More than one entry with key %(key)s found, use --info to select specific entry.') % dict(key=pkey))
+ if truncated:
+ raise errors.LimitsExceeded()
dn = entries[0][0]
return dn