From 4779865ea30dba0b5f0594cdc4633b0cc93bf36a Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 21 Jan 2013 08:39:09 -0500 Subject: Replace getList by a get_entries method The find_entries method is cumbersome to use: it requires keyword arguments for simple uses, and callers are tempted to ignore the 'truncated' flag it returns. Introduce a simpler method, get_entries, that returns the found list directly, and raises an errors if the list is truncated. Replace the getList method by get_entries. Part of the work for: https://fedorahosted.org/freeipa/ticket/2660 --- ipaserver/install/adtrustinstance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ipaserver/install/adtrustinstance.py') diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py index 52534c19..fe1ef53a 100644 --- a/ipaserver/install/adtrustinstance.py +++ b/ipaserver/install/adtrustinstance.py @@ -261,9 +261,9 @@ class ADTRUSTInstance(service.Service): """ try: - res = self.admin_conn.getList(DN(api.env.container_ranges, self.suffix), - ldap.SCOPE_ONELEVEL, - "(objectclass=ipaDomainIDRange)") + res = self.admin_conn.get_entries( + DN(api.env.container_ranges, self.suffix), + ldap.SCOPE_ONELEVEL, "(objectclass=ipaDomainIDRange)") if len(res) != 1: root_logger.critical("Found more than one ID range for the " \ "local domain.") -- cgit