Updated passwd plugins module to where it can at least be imported

This commit is contained in:
Jason Gerard DeRose 2009-01-14 22:19:31 -07:00
parent 64c072b7b3
commit ec86208a90
4 changed files with 15 additions and 11 deletions

View File

@ -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'):

View File

@ -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``.

View File

@ -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):

View File

@ -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):