1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
Commit Graph

75 Commits

Author SHA1 Message Date
Jelmer Vernooij
9e1ef61b34 samba-tool: Move main command implementation to samba.netcmd.main, so it is accessible by the testsuite. 2011-10-14 00:22:57 +02:00
Jelmer Vernooij
9213f398ad samba-tool: Don't require full prog line to be in synopsis. 2011-10-14 00:22:57 +02:00
Jelmer Vernooij
b5d5945801 samba.netcmd: Reintroduce Command.name. 2011-10-14 00:22:57 +02:00
Jelmer Vernooij
be7a75b29a samba-tool: Determine long option from docstring. 2011-10-14 00:22:56 +02:00
Jelmer Vernooij
88d997a63e samba-tool: Use self.outf in a few more places.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Oct 13 05:06:52 CEST 2011 on sn-devel-104
2011-10-13 05:06:52 +02:00
Jelmer Vernooij
6f9a3177d4 netcmd: Add Command.get_logger() method. 2011-10-13 00:23:39 +02:00
Jelmer Vernooij
63c9186e92 netcmd: Add errf stream to command instances. 2011-10-13 00:23:39 +02:00
Amitay Isaacs
46754e9665 samba-tool: epilog option to OptionParser available in python >= 2.6
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:05 +10:00
Amitay Isaacs
4d0ead86e1 samba-tool: Provide feedback if synopsis is not defined for a command
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:05 +10:00
Amitay Isaacs
e9f155f52d samba-tool: max() with key option is available in python >= 2.6
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:04 +10:00
Giampaolo Lauria
ca30b9ff3e samba-tool: Expanded acronym descriptions
Expanded command acronym descriptions
Added footnote for "server connection needed"

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:01 +10:00
Giampaolo Lauria
ef01932fdb samba-tool: Formatted subcommand list output
Formatted output of subcommand list to be a function of the
max number of chars in the longest string

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:01 +10:00
Giampaolo Lauria
fb5e27e4c8 samba-tool: Moved command definition to sambatool command
Moved subcommand definition from __init__.py to cmd_sambatool class

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:01 +10:00
Giampaolo Lauria
e309c782ba samba-tool: Add long_description and epilog to Command class
long_description and epilog should now be defined for each command.
Their string value will be printed whenever the user invokes the
command w/ the -h or --help
long_desciption will be printed after the usage statement.
epilog will be printed after the options are defined

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:01 +10:00
Giampaolo Lauria
f5e173284a samba-tool: Redefined samba-tool as a SuperCommand
Removed MainCommand class as samba-tool is a SuperCommand
Redefined samba-tool as a SuperCommand
Fixed error handling in SuperCommand _run

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:01 +10:00
Giampaolo Lauria
02650acac3 samba-tool: Removed SuperCommand usage method
Removed usage method as it is not being used anywhere

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:00 +10:00
Giampaolo Lauria
0f580c0705 samba-tool: Removed attribute name from Command class
Removed name as it is not used anywhere
Moved all the attributes on top of the class declaration

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-09-09 15:24:00 +10:00
Amitay Isaacs
cff7adb7ec samba-tool: Rename samba-tool command gpo2 --> gpo
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-03 14:26:15 +10:00
Amitay Isaacs
1a444004dd samba-tool: Raise exception on errors and report using base class
Exceptions are captured at top-level samba-tool and reported using
the base class (Command) method show_command_error().

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-28 15:20:52 +10:00
Amitay Isaacs
d4c1149e3e samba-tool: Display Usage line and list commands alphabetically
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-28 15:20:52 +10:00
Giampaolo Lauria
8de3f98ef2 samba-tool: Removed newuser
Removed newuser as its functionality has been moved to "user add"

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-28 15:20:51 +10:00
Andrew Tridgell
7f9d45bf10 samba-tool: make sure we exit with an error on a bad command
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Jul 21 04:58:01 CEST 2011 on sn-devel-104
2011-07-21 04:58:01 +02:00
Giampaolo Lauria
6e7b8aaf1d samba-tool: Fix __doc_ in base classes
Changed prog to samba-tool as prog is only meaningful in Parser

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 11:44:31 +10:00
Giampaolo Lauria
5f5eb1b003 samba-tool: removed synopsis code in base class
As it is not always possible to determine the usage of a command solely based on the list of required and optional args, it is best
to have the subclasses always define it, rather than displaying an incorrect usage statement. Currently, all commands are subclassing the synopsis.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 11:44:31 +10:00
Giampaolo Lauria
452e50919e samba-tool: Fixed bugs to determine min and max # of allowed arguments
Fixed the bugs in the code to determine both the min and the max # of allowed arguments
Changed the argument suffix convention from "*" to "+" to represent one or more arguments as:
 1. It follows the Regular expression convention ("*" means 0 or more)
 2. It is what was missing in terms of functionality
NB Currently, no command is using the "*/+", but it is a good thing to have to help out the validation of the args if/when in the future
we have such need

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 11:44:31 +10:00
Giampaolo Lauria
f03a059814 samba-tool: Improved --help functionality
Added a new --help msg
Return an error when no subcommand is specified

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 11:44:30 +10:00
Giampaolo Lauria
a2e2c130b0 samba-tool: fixed __doc__ in base classes
Replaced the "net" word with %prog in all instances

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 11:44:30 +10:00
Giampaolo Lauria
903ec440c4 samba-tool: Fix error handling in SuperCommand class
Created show_command_error method to handle errors in SuperCommand
Removed statement in SuperCommand to raise exception

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 11:44:30 +10:00
Giampaolo Lauria
f6fa868489 samba-tool: moved takes_optiongroups definition to Command base class
The option groups should be defined at the Command base class level as they are in common across all samba-tool commands.
Major move advantages:
1. more OOP approach
2. enforcing consistency across commands
3. avoiding the need of declaring for every new command

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:24 +10:00
Giampaolo Lauria
1dfcb019d2 samba-tool: removed the assignment to parser.prog
The prog should only be set if we want it to be different than the name of the program that executed it. I think that for better portability we should not set it and let it default to samba-tool.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:24 +10:00
Giampaolo Lauria
35d534b026 samba-tool: fixed prog name in samba-tool
Changed the prog name from net to samba-tool so that the usage statement is now correct

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:24 +10:00
Giampaolo Lauria
b8b20f7a46 samba-tool: removed join as it has been replaced by domain join
This is part of the samba-tool work to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:24 +10:00
Giampaolo Lauria
8f274af3f8 samba-tool: removed export as it has been moved to domain dumpkeys
The functionality of export has been moved to domain dumpkeys to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:23 +10:00
Giampaolo Lauria
0cef2bff9c samba-tool: removed domainlevel as it has been moved to domain level
The functionality of domainlevel has been moved the "domain level" to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:23 +10:00
Giampaolo Lauria
e573037ac5 samba-tool: removed machinepw as it has been moved to domain machinepassword
The functionality of machinepwd has been moved to "domain machinepassword" to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:23 +10:00
Giampaolo Lauria
e5255f0920 samba-tool: created domain object, moved pwsettings to user passwordsettings
This is part of the samba-tool work to fit the object-action model

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:22 +10:00
Giampaolo Lauria
c4a92292c1 samba-tool: update test suite for add setpassword
The test suite needs to change from setpassword to "user setpassword" to reflect the new cmd syntax

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-21 10:32:22 +10:00
Stefan Metzmacher
dee41bcdf2 s4:samba-tool: add "delegation" subcommands for S4U2Proxy and related stuff
For now this only works on the local sam.ldb, but it shouldn't be hard
to improve it to talk to remove servers.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze
2011-06-24 19:06:44 +02:00
Andrew Tridgell
0c89d624e6 s4-samba-tool: added dbcheck commmand
this will be used as a consistency checker and repair tool for
sam.ldb. This initial checkin just checks for empty attributes and
offers to fix them

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jun 10 10:31:56 CEST 2011 on sn-devel-104
2011-06-10 10:31:56 +02:00
Theresa Halloran
23177b5f44 s4:samba-tool: Move samba-tool setexpiry to samba-tool user setexpiry <user>
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-01 17:24:36 +10:00
Theresa Halloran
726ee12bb4 s4/samba-tool: Move samba-tool enableaccount to samba-tool user enable command.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-01 17:24:36 +10:00
Kai Blin
4b78956985 s4 samba-tool: Implement "testparm" command
This is a port of the existing "testparm" python script to a samba-tool
command.

Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Tue Apr  5 07:49:13 CEST 2011 on sn-devel-104
2011-04-05 07:49:13 +02:00
Andrew Tridgell
a1f96923e6 s4-samba-tool: improved exception handling in samba-tool
we now do reasonable printing on a wide range of common exception
classes, and always force a backtrace on an exception if the debug
level is >= 3

Pair-Programmed-With: Jelmer Vernooij <jelmer@samba.org>
2010-11-29 18:04:42 +11:00
Andrew Tridgell
abe9ac53f0 s4-ldapcmp: make ldapcmp a samba-tool command
The ldapcmp tool is very useful, and should be available to Samba
admins, not just developers. This makes it a samba-tool command, which
also gives it the nicer command line handling that samba-tool has
2010-11-29 18:04:42 +11:00
Andrew Tridgell
7a826d02a3 s4-samba-tool: started on gpo subcommands in python
this adds the listall GPO command. Currently the python variants are
available as "samba-tool gpo2 SUBCOMMAND". These will replace the
"samba-tool gpo" commands when complete
2010-11-29 18:04:41 +11:00
Andrew Tridgell
60bf020394 s4-samba-tool: support help, and show description of commands
when you don't specify a subcommand, show the description of the
subcommands in the list of available subcommands. Also show the list
of subcommands when you use 'help', '--help' or '-h' as a subcommand

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Sun Nov 28 01:56:46 CET 2010 on sn-devel-104
2010-11-28 01:56:46 +01:00
Andrew Tridgell
3d8d382fe5 s4-samba-tool: switched over to python version of samba-tool drs 2010-11-28 00:16:38 +11:00
Andrew Tridgell
d8f48c7ffc s4-net: added "net rodc preload" command
this command will preload the credentials for an account from the full
domain controller

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-08-26 22:50:20 +10:00
Andrew Tridgell
a2cb6ef017 s4-net: moved the net join command to python
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-08-23 15:55:39 +10:00
Matthieu Patou
cad04dabbb s4 net: Add spn module to list/add/remove spn on objects
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-07-10 11:18:17 +02:00