From 8a6f3fc3b428ad77bc116816584323bdcef55b35 Mon Sep 17 00:00:00 2001 From: Giampaolo Lauria Date: Fri, 2 Sep 2011 13:10:05 -0400 Subject: samba-tool: Fixed "delegation" command syntax Signed-off-by: Amitay Isaacs Signed-off-by: Andrew Bartlett --- .../scripting/python/samba/netcmd/delegation.py | 31 +++++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/source4/scripting/python/samba/netcmd/delegation.py b/source4/scripting/python/samba/netcmd/delegation.py index 48ec7ca25b..19a64d5f1e 100644 --- a/source4/scripting/python/samba/netcmd/delegation.py +++ b/source4/scripting/python/samba/netcmd/delegation.py @@ -56,9 +56,12 @@ def _get_user_realm_domain(user): realm = m.group(2) return (baseuser.lower(), domain, realm.upper()) + + class cmd_delegation_show(Command): """Show the delegation setting of an account.""" - synopsis = "%prog delegation show " + + synopsis = "%prog delegation show [options]" takes_args = ["accountname"] @@ -97,9 +100,12 @@ class cmd_delegation_show(Command): for a in allowed: print "msDS-AllowedToDelegateTo: %s" % (str(a)) + + class cmd_delegation_for_any_service(Command): """Set/unset UF_TRUSTED_FOR_DELEGATION for an account.""" - synopsis = "%prog delegation for-any-service on|off" + + synopsis = "%prog delegation for-any-service [(on|off)] [options]" takes_args = ["accountname", "onoff"] @@ -129,9 +135,12 @@ class cmd_delegation_for_any_service(Command): except Exception, err: raise CommandError(err) + + class cmd_delegation_for_any_protocol(Command): """Set/unset UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (S4U2Proxy) for an account.""" - synopsis = "%prog delegation for-any-protocol on|off" + + synopsis = "%prog delegation for-any-protocol [(on|off)] [options]" takes_args = ["accountname", "onoff"] @@ -161,9 +170,12 @@ class cmd_delegation_for_any_protocol(Command): except Exception, err: raise CommandError(err) + + class cmd_delegation_add_service(Command): """Add a service principal as msDS-AllowedToDelegateTo""" - synopsis = "%prog delegation add-service " + + synopsis = "%prog delegation add-service [options]" takes_args = ["accountname", "principal"] @@ -194,9 +206,12 @@ class cmd_delegation_add_service(Command): except Exception, err: raise CommandError(err) + + class cmd_delegation_del_service(Command): - """Add a service principal as msDS-AllowedToDelegateTo""" - synopsis = "%prog delegation del-service " + """Delete a service principal as msDS-AllowedToDelegateTo""" + + synopsis = "%prog delegation del-service [options]" takes_args = ["accountname", "principal"] @@ -227,8 +242,10 @@ class cmd_delegation_del_service(Command): except Exception, err: raise CommandError(err) + + class cmd_delegation(SuperCommand): - """Delegation management *""" + """Delegation management""" subcommands = {} subcommands["show"] = cmd_delegation_show() -- cgit