diff options
author | Giampaolo Lauria <lauria2@yahoo.com> | 2011-09-02 12:52:54 -0400 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-09-09 15:24:02 +1000 |
commit | de8e47a4e3e44edea7b0b671f547b950dc518b42 (patch) | |
tree | 069b3a4b836562829e4b27c03b5b021199e94c88 | |
parent | 8a6f3fc3b428ad77bc116816584323bdcef55b35 (diff) | |
download | samba-de8e47a4e3e44edea7b0b671f547b950dc518b42.tar.gz samba-de8e47a4e3e44edea7b0b671f547b950dc518b42.tar.bz2 samba-de8e47a4e3e44edea7b0b671f547b950dc518b42.zip |
samba-tool: Fixed "spn" command syntax
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | source4/scripting/python/samba/netcmd/spn.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source4/scripting/python/samba/netcmd/spn.py b/source4/scripting/python/samba/netcmd/spn.py index d43b0afd02..6e9d2dece8 100644 --- a/source4/scripting/python/samba/netcmd/spn.py +++ b/source4/scripting/python/samba/netcmd/spn.py @@ -32,6 +32,8 @@ from samba.netcmd import ( Option ) + + def _get_user_realm_domain(user): """ get the realm or the domain and the base user from user like: @@ -39,6 +41,7 @@ def _get_user_realm_domain(user): * DOMAIN\username * username@REALM """ + baseuser = user realm = "" domain = "" @@ -53,9 +56,12 @@ def _get_user_realm_domain(user): realm = m.group(2) return (baseuser.lower(), domain, realm.upper()) + + class cmd_spn_list(Command): """List spns of a given user.""" - synopsis = "%prog spn list <user>" + + synopsis = "%prog spn list <user> [options]" takes_args = ["user"] @@ -80,15 +86,17 @@ class cmd_spn_list(Command): print "User %s has the following servicePrincipalName: " % str(res[0].dn) for e in spns: print "\t %s" % (str(e)) - else: print "User %s has no servicePrincipalName" % str(res[0].dn) else: raise CommandError("User %s not found" % user) + + class cmd_spn_add(Command): """Create a new spn.""" - synopsis = "%prog spn add [--force] <name> <user>" + + synopsis = "%prog spn add <name> <user> [options]" takes_options = [ Option("--force", help="Force the addition of the spn"\ @@ -139,9 +147,11 @@ class cmd_spn_add(Command): raise CommandError("User %s not found" % user) + class cmd_spn_delete(Command): """Delete a spn.""" - synopsis = "%prog spn delete <name> [user]" + + synopsis = "%prog spn delete <name> [user] [options]" takes_args = ["name", "user?"] @@ -191,8 +201,10 @@ class cmd_spn_delete(Command): else: raise CommandError("Service principal %s not affected" % name) + + class cmd_spn(SuperCommand): - """Service Principal Name (SPN) management *""" + """Service Principal Name (SPN) management""" subcommands = {} subcommands["add"] = cmd_spn_add() |