diff options
author | Petr Viktorin <pviktori@redhat.com> | 2013-01-31 09:02:01 -0500 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2013-03-13 12:36:34 +0100 |
commit | cf4b52111d384e8baa250aefe57f21ebda4dad7e (patch) | |
tree | 4069d1af85b0a8dd91f57e13bb95aad841d8521c /ipalib | |
parent | 664248d5b846321f61e0776b646cca82c5a17884 (diff) | |
download | freeipa-cf4b52111d384e8baa250aefe57f21ebda4dad7e.tar.gz freeipa-cf4b52111d384e8baa250aefe57f21ebda4dad7e.tar.xz freeipa-cf4b52111d384e8baa250aefe57f21ebda4dad7e.zip |
Remove unneeded python-ldap imports
Part of the work for: https://fedorahosted.org/freeipa/ticket/2660
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/automount.py | 8 | ||||
-rw-r--r-- | ipalib/plugins/migration.py | 11 |
2 files changed, 9 insertions, 10 deletions
diff --git a/ipalib/plugins/automount.py b/ipalib/plugins/automount.py index 22017fb5..a7596b47 100644 --- a/ipalib/plugins/automount.py +++ b/ipalib/plugins/automount.py @@ -18,13 +18,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import os + from ipalib import api, errors from ipalib import Object, Command from ipalib import Flag, Str, IA5Str from ipalib.plugins.baseldap import * from ipalib import _, ngettext -import ldap as _ldap -import os __doc__ = _(""" Automount @@ -726,8 +726,8 @@ class automountkey(LDAPObject): ('cn', parent_keys[0]), self.container_dn, api.env.basedn) attrs_list = ['*'] - (entries, truncated) = ldap.find_entries(sfilter, attrs_list, - basedn, _ldap.SCOPE_ONELEVEL) + entries, truncated = ldap.find_entries( + sfilter, attrs_list, 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: diff --git a/ipalib/plugins/migration.py b/ipalib/plugins/migration.py index 7884e08c..f57f0957 100644 --- a/ipalib/plugins/migration.py +++ b/ipalib/plugins/migration.py @@ -18,7 +18,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import re -import ldap as _ldap from ipalib import api, errors, output from ipalib import Command, Password, Str, Flag, StrEnum, DNParam @@ -286,7 +285,7 @@ def _update_default_group(ldap, pkey, config, ctx, force): searchfilter = "(&(objectclass=posixAccount)(!(memberof=%s)))" % group_dn try: (result, truncated) = ldap.find_entries(searchfilter, - [''], api.env.container_user, scope=_ldap.SCOPE_SUBTREE, + [''], api.env.container_user, scope=ldap.SCOPE_SUBTREE, time_limit = -1) except errors.NotFound: return @@ -701,9 +700,9 @@ can use their Kerberos accounts.''') failed[ldap_obj_name] = {} try: - (entries, truncated) = ds_ldap.find_entries( + entries, truncated = ds_ldap.find_entries( search_filter, ['*'], search_bases[ldap_obj_name], - _ldap.SCOPE_ONELEVEL, + ds_ldap.SCOPE_ONELEVEL, time_limit=0, size_limit=-1, search_refs=True # migrated DS may contain search references ) @@ -872,9 +871,9 @@ can use their Kerberos accounts.''') if not ds_base_dn: # retrieve base DN from remote LDAP server - (entries, truncated) = ds_ldap.find_entries( + entries, truncated = ds_ldap.find_entries( '', ['namingcontexts', 'defaultnamingcontext'], DN(''), - _ldap.SCOPE_BASE, size_limit=-1, time_limit=0, + ds_ldap.SCOPE_BASE, size_limit=-1, time_limit=0, ) if 'defaultnamingcontext' in entries[0][1]: ds_base_dn = DN(entries[0][1]['defaultnamingcontext'][0]) |