summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcrit@ipa.greyoak.com>2008-07-21 15:36:21 -0400
committerRob Crittenden <rcrit@ipa.greyoak.com>2008-07-23 10:05:32 -0400
commit23fab304e97d4b275037e066ab93c44e0ed8ae96 (patch)
tree9d3f9a5032d5051e924ff3bc24251335c082d617
parentf7ca405716b1ee8b92a940e07cd611f6b025795d (diff)
downloadfreeipa-23fab304e97d4b275037e066ab93c44e0ed8ae96.tar.gz
freeipa-23fab304e97d4b275037e066ab93c44e0ed8ae96.tar.xz
freeipa-23fab304e97d4b275037e066ab93c44e0ed8ae96.zip
Catch correct exception when trying to find the default IPA users group and return a more detailed error message.
455092
-rw-r--r--ipa-server/xmlrpc-server/funcs.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py
index 1491c0a65..32d89e2ba 100644
--- a/ipa-server/xmlrpc-server/funcs.py
+++ b/ipa-server/xmlrpc-server/funcs.py
@@ -606,9 +606,9 @@ class IPAServer:
user['gidnumber'] = default_group.get('gidnumber')
except ipaerror.exception_for(ipaerror.LDAP_DATABASE_ERROR), e:
raise ipaerror.gen_exception(ipaerror.LDAP_DATABASE_ERROR, message=None, nested_exception=e.detail)
- except ipaerror.exception_for(ipaerror.LDAP_DATABASE_ERROR):
+ except ipaerror.exception_for(ipaerror.LDAP_NOT_FOUND):
# Fake an LDAP error so we can return something useful to the user
- raise ipaerror.gen_exception(ipaerror.LDAP_NOT_FOUND, "No default group for new users can be found.")
+ raise ipaerror.gen_exception(ipaerror.LDAP_NOT_FOUND, "The default group for new users, '%s', cannot be found." % config.get('ipadefaultprimarygroup'))
if user.get('krbprincipalname') is None:
user['krbprincipalname'] = "%s@%s" % (user.get('uid'), self.realm)