summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-02-06 23:26:36 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-02-07 01:11:08 +0100
commit8dca1a022242d69e6d35c10ddb796081a6b497a2 (patch)
tree3b4fd45c0495a405fa20f7701ae19a4e4ebc553e /source4/scripting
parent7c8476b434a9e305ecb90712d800e6560b45200f (diff)
downloadsamba-8dca1a022242d69e6d35c10ddb796081a6b497a2.tar.gz
samba-8dca1a022242d69e6d35c10ddb796081a6b497a2.tar.bz2
samba-8dca1a022242d69e6d35c10ddb796081a6b497a2.zip
samba-tool user password: Re-add support for option groups.
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/netcmd/user.py17
1 files changed, 13 insertions, 4 deletions
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):