diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-04-20 13:58:26 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-04-20 13:58:26 -0400 |
commit | 64fa3dd4c3a03e7a677453c9150f84ffc4e91c7a (patch) | |
tree | a4543df175f8bf0efcd200662a9e7f00fea7bf52 /ipalib/plugins/passwd.py | |
parent | a9387b48e66ca93cc8323869de25fe3f777567b6 (diff) | |
download | freeipa-64fa3dd4c3a03e7a677453c9150f84ffc4e91c7a.tar.gz freeipa-64fa3dd4c3a03e7a677453c9150f84ffc4e91c7a.tar.xz freeipa-64fa3dd4c3a03e7a677453c9150f84ffc4e91c7a.zip |
Finish work replacing the errors module with errors2
Once this is committed we can start the process of renaming errors2 as errors.
I thought that combinig this into one commit would be more difficult to
review.
Diffstat (limited to 'ipalib/plugins/passwd.py')
-rw-r--r-- | ipalib/plugins/passwd.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ipalib/plugins/passwd.py b/ipalib/plugins/passwd.py index a599276f4..cc7ab5861 100644 --- a/ipalib/plugins/passwd.py +++ b/ipalib/plugins/passwd.py @@ -21,7 +21,7 @@ Frontend plugins for password changes. """ -from ipalib import api, errors, util +from ipalib import api, errors2, util from ipalib import Command # Plugin base classes from ipalib import Str, Password # Parameter types @@ -30,13 +30,13 @@ class passwd(Command): 'Edit existing password policy.' takes_args = ( - Password('password'), - Str('principal?', + Str('principal', cli_name='user', primary_key=True, autofill=True, - default_from=util.get_current_principal, + create_default=lambda **kw: util.get_current_principal(), ), + Password('password'), ) def execute(self, principal, password): @@ -48,13 +48,13 @@ class passwd(Command): Returns the entry - :param param uid: The login name of the user being updated. - :param kw: Not used. + :param principal: The login name or principal of the user + :param password: the new password """ if principal.find('@') > 0: u = principal.split('@') if len(u) > 2: - raise errors.InvalidUserPrincipal(principal) + raise errors2.MalformedUserPrincipal(principal=principal) else: principal = principal+"@"+self.api.env.realm dn = self.Backend.ldap.find_entry_dn( |