diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2009-01-14 22:19:31 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2009-01-14 22:19:31 -0700 |
commit | ec86208a9007ec9febca620c777b80b20e9c360d (patch) | |
tree | 2e13b9081e0f0c6757e54a52597bd2f4d0c9b649 | |
parent | 64c072b7b3deb1800c242b365e277591f056093d (diff) | |
download | freeipa-ec86208a9007ec9febca620c777b80b20e9c360d.tar.gz freeipa-ec86208a9007ec9febca620c777b80b20e9c360d.tar.xz freeipa-ec86208a9007ec9febca620c777b80b20e9c360d.zip |
Updated passwd plugins module to where it can at least be imported
-rw-r--r-- | ipalib/__init__.py | 2 | ||||
-rw-r--r-- | ipalib/parameters.py | 6 | ||||
-rw-r--r-- | ipalib/plugins/f_group.py | 2 | ||||
-rw-r--r-- | ipalib/plugins/f_passwd.py | 16 |
4 files changed, 15 insertions, 11 deletions
diff --git a/ipalib/__init__.py b/ipalib/__init__.py index 40d3a744..e5aa65d6 100644 --- a/ipalib/__init__.py +++ b/ipalib/__init__.py @@ -874,7 +874,7 @@ import plugable from backend import Backend, Context from frontend import Command, LocalOrRemote, Application from frontend import Object, Method, Property -from parameters import DefaultFrom, Bool, Flag, Int, Float, Bytes, Str +from parameters import DefaultFrom, Bool, Flag, Int, Float, Bytes, Str, Password def create_api(mode='dummy'): diff --git a/ipalib/parameters.py b/ipalib/parameters.py index cf658a41..fd693e71 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -892,6 +892,12 @@ class Str(Data): ) +class Password(Str): + """ + A parameter for passwords (stored in the ``unicode`` type). + """ + + def create_param(spec): """ Create an `Str` instance from the shorthand ``spec``. diff --git a/ipalib/plugins/f_group.py b/ipalib/plugins/f_group.py index c9d7b86b..740b32f8 100644 --- a/ipalib/plugins/f_group.py +++ b/ipalib/plugins/f_group.py @@ -23,7 +23,7 @@ Frontend plugins for group (Identity). from ipalib import api, crud, errors from ipalib import Object, Command # Plugin base classes -from ipalib import Str, Int # Parameter types +from ipalib import Str, Int # Parameter types def get_members(members): diff --git a/ipalib/plugins/f_passwd.py b/ipalib/plugins/f_passwd.py index 1e0dfc1c..ea78c4c1 100644 --- a/ipalib/plugins/f_passwd.py +++ b/ipalib/plugins/f_passwd.py @@ -21,23 +21,21 @@ Frontend plugins for password changes. """ -from ipalib import frontend -from ipalib.frontend import Param -from ipalib import api -from ipalib import errors -from ipalib import ipa_types -from ipalib import util +from ipalib import api, errors, util +from ipalib import Command # Plugin base classes +from ipalib import Str, Password # Parameter types -class passwd(frontend.Command): + +class passwd(Command): 'Edit existing password policy.' takes_args = ( - Param('principal', + Str('principal', cli_name='user', primary_key=True, default_from=util.get_current_principal, ), - Param('password', flags=['password']), + Password('password'), ) def execute(self, principal, password): |