[SCM] Samba Shared Repository - branch master updated

Andrew Tridgell tridge at samba.org
Sat Nov 27 17:57:01 MST 2010


The branch, master has been updated
       via  60bf020 s4-samba-tool: support help, and show description of commands
       via  2a4c6da s4-drs: fixed credit for C version
      from  b87c370 s4:netcmd/drs.py - use "objectClass" for discovering the server and it's NTDS settings object

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 60bf020394f5006dc343a8477c7621ca00f7ce88
Author: Andrew Tridgell <tridge at samba.org>
Date:   Sun Nov 28 10:52:09 2010 +1100

    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 at samba.org>
    Autobuild-Date: Sun Nov 28 01:56:46 CET 2010 on sn-devel-104

commit 2a4c6da7835cb6129a68e3e6e6c16e8f0a656eb2
Author: Andrew Tridgell <tridge at samba.org>
Date:   Sun Nov 28 10:41:53 2010 +1100

    s4-drs: fixed credit for C version

-----------------------------------------------------------------------

Summary of changes:
 source4/scripting/python/samba/netcmd/__init__.py |   14 +++++++-------
 source4/scripting/python/samba/netcmd/drs.py      |    2 ++
 2 files changed, 9 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py
index dafdd77..af317ab 100644
--- a/source4/scripting/python/samba/netcmd/__init__.py
+++ b/source4/scripting/python/samba/netcmd/__init__.py
@@ -112,14 +112,14 @@ class SuperCommand(Command):
     subcommands = {}
 
     def _run(self, myname, subcommand=None, *args):
-        if subcommand is None:
-            print "Available subcommands:"
-            for subcommand in self.subcommands:
-                print "\t%s" % subcommand
+        if subcommand in self.subcommands:
+            return self.subcommands[subcommand]._run(subcommand, *args)
+        print "Available subcommands:"
+        for cmd in self.subcommands:
+            print "\t%-20s - %s" % (cmd, self.subcommands[cmd].description)
+        if subcommand in [None, 'help', '-h', '--help' ]:
             return 0
-        if not subcommand in self.subcommands:
-            raise CommandError("No such subcommand '%s'" % subcommand)
-        return self.subcommands[subcommand]._run(subcommand, *args)
+        raise CommandError("No such subcommand '%s'" % subcommand)
 
     def usage(self, myname, subcommand=None, *args):
         if subcommand is None or not subcommand in self.subcommands:
diff --git a/source4/scripting/python/samba/netcmd/drs.py b/source4/scripting/python/samba/netcmd/drs.py
index e7a631b..6816790 100644
--- a/source4/scripting/python/samba/netcmd/drs.py
+++ b/source4/scripting/python/samba/netcmd/drs.py
@@ -4,6 +4,8 @@
 #
 # Copyright Andrew Tridgell 2010
 #
+# based on C implementation by Kamen Mazdrashki <kamen.mazdrashki at postpath.com>
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or


-- 
Samba Shared Repository


More information about the samba-cvs mailing list