samba-tool user password: Re-add support for option groups.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 6 Feb 2012 22:26:36 +0000 (23:26 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 7 Feb 2012 00:11:08 +0000 (01:11 +0100)
source4/scripting/python/samba/netcmd/user.py

index a8cc2b840f4ca946219c1b753880ab655c5a2888..9a935244709ceb6a89e38fbc2a354be047ab67b0 100644 (file)
@@ -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):