diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-20 15:00:00 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-20 15:00:00 -0700 |
commit | 6fdf5d1e7bb2171646e17cac835be54a4104b5ac (patch) | |
tree | 85c084784809b3592d109a116792a0621130146f /ipalib/plugins/f_passwd.py | |
parent | 9a69adeef001ddd0c55513271cf02eedc0a9aef8 (diff) | |
parent | c025ed6404e147f19b71b398e920fd1b3a05452a (diff) | |
download | freeipa.git-6fdf5d1e7bb2171646e17cac835be54a4104b5ac.tar.gz freeipa.git-6fdf5d1e7bb2171646e17cac835be54a4104b5ac.tar.xz freeipa.git-6fdf5d1e7bb2171646e17cac835be54a4104b5ac.zip |
Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2
Diffstat (limited to 'ipalib/plugins/f_passwd.py')
-rw-r--r-- | ipalib/plugins/f_passwd.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ipalib/plugins/f_passwd.py b/ipalib/plugins/f_passwd.py index edc13b63..1e0dfc1c 100644 --- a/ipalib/plugins/f_passwd.py +++ b/ipalib/plugins/f_passwd.py @@ -52,14 +52,12 @@ class passwd(frontend.Command): :param param uid: The login name of the user being updated. :param kw: Not used. """ - if principal.find('@') < 0: + if principal.find('@') > 0: u = principal.split('@') - if len(u) > 2 or len(u) == 0: - print "Invalid user name (%s)" % principal - if len(u) == 1: - principal = principal+"@"+self.api.env.realm - else: - principal = principal + if len(u) > 2: + raise errors.InvalidUserPrincipal, principal + else: + principal = principal+"@"+self.api.env.realm dn = self.Backend.ldap.find_entry_dn( "krbprincipalname", principal, |