mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
raise exceptions in the proper form
This commit is contained in:
@@ -54,7 +54,7 @@ class passwd(Command):
|
||||
if principal.find('@') > 0:
|
||||
u = principal.split('@')
|
||||
if len(u) > 2:
|
||||
raise errors.InvalidUserPrincipal, principal
|
||||
raise errors.InvalidUserPrincipal(principal)
|
||||
else:
|
||||
principal = principal+"@"+self.api.env.realm
|
||||
dn = self.Backend.ldap.find_entry_dn(
|
||||
|
||||
@@ -160,7 +160,7 @@ class user_add(crud.Create):
|
||||
kw['gidnumber'] = default_group.get('gidnumber')
|
||||
except errors2.NotFound:
|
||||
# Fake an LDAP error so we can return something useful to the kw
|
||||
raise errors2.NotFound, "The default group for new users, '%s', cannot be found." % config.get('ipadefaultprimarygroup')
|
||||
raise errors2.NotFound("The default group for new users, '%s', cannot be found." % config.get('ipadefaultprimarygroup'))
|
||||
except Exception, e:
|
||||
# catch everything else
|
||||
raise e
|
||||
|
||||
Reference in New Issue
Block a user