summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-11-01 12:29:16 +0100
committerJelmer Vernooij <jelmer@samba.org>2011-11-01 14:25:39 +0100
commit4b67a10ed04d0d8e2aec9f6d8a07f4c883c58d75 (patch)
tree07fc0f5534e4d17698dab8661dc1d79bc472f1d9
parentb26a4f6232219746fd8ed1b107476f3c23c6908e (diff)
downloadsamba-4b67a10ed04d0d8e2aec9f6d8a07f4c883c58d75.tar.gz
samba-4b67a10ed04d0d8e2aec9f6d8a07f4c883c58d75.tar.bz2
samba-4b67a10ed04d0d8e2aec9f6d8a07f4c883c58d75.zip
Simplify handling of user add command.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Tue Nov 1 14:25:39 CET 2011 on sn-devel-104
-rw-r--r--source4/scripting/python/samba/netcmd/user.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py
index e10df21029..308b170d5d 100644
--- a/source4/scripting/python/samba/netcmd/user.py
+++ b/source4/scripting/python/samba/netcmd/user.py
@@ -41,12 +41,6 @@ class cmd_user_create(Command):
synopsis = "%prog <username> [<password>] [options]"
- # take this print out after the add subcommand is removed.
- # the add subcommand is deprecated but left in for now to allow people to migrate to create
- if (len(sys.argv) > 2):
- if ((sys.argv[2]) == 'add'):
- print "\nNote: samba-tool user add is deprecated. Please use samba-tool user create for the same function.\n"
-
takes_options = [
Option("-H", "--URL", help="LDB URL for database or target server", type=str,
metavar="URL", dest="H"),
@@ -109,6 +103,16 @@ class cmd_user_create(Command):
self.outf.write("User '%s' created successfully\n" % username)
+class cmd_user_add(cmd_user_create):
+ __doc__ = cmd_user_create.__doc__
+ # take this print out after the add subcommand is removed.
+ # the add subcommand is deprecated but left in for now to allow people to migrate to create
+
+ def run(self, *args, **kwargs):
+ self.err.write("\nNote: samba-tool user add is deprecated. Please use samba-tool user create for the same function.\n")
+ return super(self, cmd_user_add).run(*args, **kwargs)
+
+
class cmd_user_delete(Command):
"""Delete a user"""