summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-09-27 13:50:54 -0400
committerRob Crittenden <rcritten@redhat.com>2010-09-28 13:39:28 -0400
commitc298560a1e733908148224b0fef6cc6042cbbe82 (patch)
tree2947a48243f84918c8e47c06a325a7f732b55119 /ipaserver/plugins
parent38b8532696b4c969e437452386b7019d1266a69c (diff)
downloadfreeipa-c298560a1e733908148224b0fef6cc6042cbbe82.tar.gz
freeipa-c298560a1e733908148224b0fef6cc6042cbbe82.tar.xz
freeipa-c298560a1e733908148224b0fef6cc6042cbbe82.zip
Handle an empty base_dn and no cn=ipaconfig in the ldap2 backend, fix migration.
We lacked good error messages if the user/group container you used doesn't exist. Add a --continue option so things can continue if you use a bad user/group container. This has the side-effect of letting you migrate just users or groups by using a bad container for the one you don't want. Fix a Gettext() error when displaying the migrated password message. ticket 289
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/ldap2.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py
index b6313d85a..2213df0eb 100644
--- a/ipaserver/plugins/ldap2.py
+++ b/ipaserver/plugins/ldap2.py
@@ -231,7 +231,10 @@ class ldap2(CrudBackend, Encoder):
except AttributeError:
self.ldap_uri = 'ldap://example.com'
try:
- self.base_dn = base_dn or api.env.basedn
+ if base_dn is not None:
+ self.base_dn = base_dn
+ else:
+ self.base_dn = api.env.basedn
except AttributeError:
self.base_dn = ''
self.schema = schema or _schema
@@ -552,8 +555,13 @@ class ldap2(CrudBackend, Encoder):
def get_ipa_config(self):
"""Returns the IPA configuration entry (dn, entry_attrs)."""
cdn = "%s,%s" % (api.Object.config.get_dn(), api.env.basedn)
- return self.find_entries(None, None, cdn, self.SCOPE_BASE,
- time_limit=2, size_limit=10)[0][0]
+ try:
+ return self.find_entries(None, None, cdn, self.SCOPE_BASE,
+ time_limit=2, size_limit=10)[0][0]
+ except errors.NotFound:
+ return (cdn, {'ipasearchtimelimit': [2], 'ipasearchrecordslimit': [0]})
+ except Exception, e:
+ raise e
def get_schema(self):
"""Returns a copy of the current LDAP schema."""