s4: samba-tool subcommand rename - change samba-tool user add to samba-tool user...
authorTheresa Halloran <thallora@linux.vnet.ibm.com>
Sun, 23 Oct 2011 22:23:28 +0000 (15:23 -0700)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 23 Oct 2011 22:23:28 +0000 (15:23 -0700)
Signed-off-by: Theresa Halloran <thallora@linux.vnet.ibm.com>
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
source4/scripting/python/samba/netcmd/user.py
source4/setup/tests/blackbox_group.sh
source4/setup/tests/blackbox_newuser.sh
source4/setup/tests/blackbox_setpassword.sh
testprogs/blackbox/test_export_keytab.sh
testprogs/blackbox/test_kinit.sh
testprogs/blackbox/test_passwords.sh

index cbac5affbee5c87d84858484b9dffff160a50d0d..e10df21029469f714a3753062800c08368a623fe 100644 (file)
@@ -36,11 +36,17 @@ from samba.netcmd import (
     )
 
 
-class cmd_user_add(Command):
+class cmd_user_create(Command):
     """Creates a new user"""
 
     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"),
@@ -289,7 +295,8 @@ class cmd_user(SuperCommand):
     """User management"""
 
     subcommands = {}
-    subcommands["add"] = cmd_user_add()
+    subcommands["add"] = cmd_user_create()
+    subcommands["create"] = cmd_user_create()
     subcommands["delete"] = cmd_user_delete()
     subcommands["enable"] = cmd_user_enable()
     subcommands["setexpiry"] = cmd_user_setexpiry()
index 6c58e91dfd2939e985af3e9dd4b9f847ccaac63f..08b8e5b56e22643606240a45dbb0d18be8881015 100755 (executable)
@@ -20,8 +20,8 @@ samba_tool="./bin/samba-tool"
 CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf"
 
 #creation of two test subjects
-testit "user add" $samba_tool user add $CONFIG --given-name="User" --surname="Tester" --initial="UT" testuser testp@ssw0Rd
-testit "user add" $samba_tool user add $CONFIG --given-name="User1" --surname="Tester" --initial="UT" testuser1 testp@ssw0Rd
+testit "user add" $samba_tool user create $CONFIG --given-name="User" --surname="Tester" --initial="UT" testuser testp@ssw0Rd
+testit "user add" $samba_tool user create $CONFIG --given-name="User1" --surname="Tester" --initial="UT" testuser1 testp@ssw0Rd
 
 #test creation of six different groups
 testit "group add" $samba_tool group add $CONFIG --group-scope='Domain' --group-type='Security' --description='DomainSecurityGroup' --mail-address='dsg@samba.org' --notes='Notes' dsg
index c6046846ea4a6010e99cadc29e12a90a7072736d..e048dcdefd7b384cae3d5e7a676202810301f9a9 100755 (executable)
@@ -22,8 +22,8 @@ CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf"
 #two test for creating new user
 #newuser  account is created with cn=Given Name Initials. Surname
 #newuser1 account is created using cn=username
-testit "user add" $samba_tool user add $CONFIG --given-name="User" --surname="Tester" --initials="T" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser testp@ssw0Rd
-testit "user add" $samba_tool user add $CONFIG --use-username-as-cn --given-name="User1" --surname="Tester1" --initials="UT1" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser1 testp@ssw0Rd
+testit "user add" $samba_tool user create $CONFIG --given-name="User" --surname="Tester" --initials="T" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser testp@ssw0Rd
+testit "user add" $samba_tool user create $CONFIG --use-username-as-cn --given-name="User1" --surname="Tester1" --initials="UT1" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser1 testp@ssw0Rd
 
 # check the enable account script
 testit "enableaccount" $samba_tool user enable $CONFIG NewUser
index 8858767ef73a7ffc65e582a99f1603ca36e406b0..e99cdcc158fe1bf0d4c2eb0658422f776ec2c0b5 100755 (executable)
@@ -17,7 +17,7 @@ samba_tool="./bin/samba-tool"
 rm -rf $PREFIX/simple-dc
 testit "simple-dc" $PYTHON $SRCDIR/source4/setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc
 
-testit "user add" $samba_tool user add --configfile=$PREFIX/simple-dc/etc/smb.conf testuser testp@ssw0Rd
+testit "user add" $samba_tool user create --configfile=$PREFIX/simple-dc/etc/smb.conf testuser testp@ssw0Rd
 
 testit "setpassword" $samba_tool user setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testp@ssw0Rd
 
index 351a67d7935e4d0211a53c59c6101d53c4ca7360..7c637042d45721ef9f5e07757dd5da26afd71525 100755 (executable)
@@ -22,7 +22,7 @@ samba4bindir="$BINDIR"
 smbclient="$samba4bindir/smbclient$EXEEXT"
 samba4kinit="$samba4bindir/samba4kinit$EXEEXT"
 samba_tool="$samba4bindir/samba-tool$EXEEXT"
-newuser="$samba_tool user add"
+newuser="$samba_tool user create"
 
 . `dirname $0`/subunit.sh
 
index 0b4e2d35e7e02dadbdb079a09b7f067d562caecb..293115fc09500af2b2027fbe72cb96f7c58cda7f 100755 (executable)
@@ -73,7 +73,7 @@ testit "check time with kerberos ccache" $VALGRIND $samba_tool time $SERVER $CON
 
 USERPASS=testPass@12%
 echo $USERPASS > $PREFIX/tmpuserpassfile
-testit "add user with kerberos ccache" $VALGRIND $samba_tool user add nettestuser $USERPASS $CONFIGURATION  -k yes $@ || failed=`expr $failed + 1`
+testit "add user with kerberos ccache" $VALGRIND $samba_tool user create nettestuser $USERPASS $CONFIGURATION  -k yes $@ || failed=`expr $failed + 1`
 
 echo "Getting defaultNamingContext"
 BASEDN=`$ldbsearch $options --basedn='' -H ldap://$SERVER -s base DUMMY=x defaultNamingContext | grep defaultNamingContext | awk '{print $2}'`
index 3d1c559496533f1ead9644dce812a68fce72bfcd..ed6866558f0feddfdc8a4ba70d5120503e0951d5 100755 (executable)
@@ -25,7 +25,7 @@ samba4kinit="$samba4bindir/samba4kinit$EXEEXT"
 samba_tool="$samba4bindir/samba-tool$EXEEXT"
 rkpty="$samba4bindir/rkpty$EXEEXT"
 samba4kpasswd="$samba4bindir/samba4kpasswd$EXEEXT"
-newuser="$samba_tool user add"
+newuser="$samba_tool user create"
 
 . `dirname $0`/subunit.sh