From: Jelmer Vernooij Date: Mon, 6 Feb 2012 22:26:36 +0000 (+0100) Subject: samba-tool user password: Re-add support for option groups. X-Git-Url: http://git.samba.org/?a=commitdiff_plain;ds=sidebyside;h=8dca1a022242d69e6d35c10ddb796081a6b497a2;p=tridge%2Fsamba.git samba-tool user password: Re-add support for option groups. --- diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py index a8cc2b840f..9a93524470 100644 --- a/source4/scripting/python/samba/netcmd/user.py +++ b/source4/scripting/python/samba/netcmd/user.py @@ -118,7 +118,7 @@ Example3 shows how to create a new user in the OrgUnit organizational unit. if random_password: password = generate_random_password(128, 255) - while 1: + while True: if password is not None and password is not '': break password = getpass("New Password: ") @@ -317,6 +317,12 @@ class cmd_user_disable(Command): takes_args = ["username?"] + takes_optiongroups = { + "sambaopts": options.SambaOptions, + "credopts": options.CredentialsOptions, + "versionopts": options.VersionOptions, + } + def run(self, username=None, sambaopts=None, credopts=None, versionopts=None, filter=None, H=None): if username is None and filter is None: @@ -409,9 +415,6 @@ Example4 shows how to set the account expiration so that it will never expire. class cmd_user_password(Command): """Change password for a user account (the one provided in authentication) - - - """ synopsis = "%prog [options]" @@ -420,6 +423,12 @@ class cmd_user_password(Command): Option("--newpassword", help="New password", type=str), ] + takes_optiongroups = { + "sambaopts": options.SambaOptions, + "credopts": options.CredentialsOptions, + "versionopts": options.VersionOptions, + } + def run(self, credopts=None, sambaopts=None, versionopts=None, newpassword=None):