From: Rob van der Linde Date: Thu, 23 Nov 2023 01:08:04 +0000 (+1300) Subject: netcmd: auth: set better metavar that matches the docs X-Git-Tag: talloc-2.4.2~541 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c5a7d1244554136d1fc4f556b6f1bf91df61a7f;p=thirdparty%2Fsamba.git netcmd: auth: set better metavar that matches the docs Signed-off-by: Rob van der Linde Reviewed-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/domain/auth/policy.py b/python/samba/netcmd/domain/auth/policy.py index 32a24adafee..ca4f6125cf4 100644 --- a/python/samba/netcmd/domain/auth/policy.py +++ b/python/samba/netcmd/domain/auth/policy.py @@ -60,27 +60,33 @@ class UserOptions(options.OptionGroup): self.add_option("--user-allowed-to-authenticate-from", help="Conditions user is allowed to authenticate from.", type=str, dest="allowed_to_authenticate_from", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SDDL") self.add_option("--user-allowed-to-authenticate-from-device-silo", help="User is allowed to authenticate from a device in a silo.", type=str, dest="allowed_to_authenticate_from_device_silo", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SILO") self.add_option("--user-allowed-to-authenticate-from-device-group", help="User is allowed to authenticate from a device in group.", type=str, dest="allowed_to_authenticate_from_device_group", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="GROUP") self.add_option("--user-allowed-to-authenticate-to", help="Conditions user is allowed to authenticate to.", type=str, dest="allowed_to_authenticate_to", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SDDL") self.add_option("--user-allowed-to-authenticate-to-by-group", help="User is allowed to authenticate to by group.", type=str, dest="allowed_to_authenticate_to_by_group", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="GROUP") self.add_option("--user-allowed-to-authenticate-to-by-silo", help="User is allowed to authenticate to by silo.", type=str, dest="allowed_to_authenticate_to_by_silo", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SILO") class ServiceOptions(options.OptionGroup): @@ -102,27 +108,33 @@ class ServiceOptions(options.OptionGroup): self.add_option("--service-allowed-to-authenticate-from", help="Conditions service is allowed to authenticate from.", type=str, dest="allowed_to_authenticate_from", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SDDL") self.add_option("--service-allowed-to-authenticate-from-device-silo", help="Service is allowed to authenticate from a device in a silo.", type=str, dest="allowed_to_authenticate_from_device_silo", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SILO") self.add_option("--service-allowed-to-authenticate-from-device-group", help="Service is allowed to authenticate from a device in group.", type=str, dest="allowed_to_authenticate_from_device_group", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="GROUP") self.add_option("--service-allowed-to-authenticate-to", help="Conditions service is allowed to authenticate to.", type=str, dest="allowed_to_authenticate_to", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SDDL") self.add_option("--service-allowed-to-authenticate-to-by-group", help="Service is allowed to authenticate to by group.", type=str, dest="allowed_to_authenticate_to_by_group", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="GROUP") self.add_option("--service-allowed-to-authenticate-to-by-silo", help="Service is allowed to authenticate to by silo.", type=str, dest="allowed_to_authenticate_to_by_silo", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SILO") class ComputerOptions(options.OptionGroup): @@ -139,15 +151,18 @@ class ComputerOptions(options.OptionGroup): self.add_option("--computer-allowed-to-authenticate-to", help="Conditions computer is allowed to authenticate to.", type=str, dest="allowed_to_authenticate_to", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SDDL") self.add_option("--computer-allowed-to-authenticate-to-by-group", help="Computer is allowed to authenticate to by group.", type=str, dest="allowed_to_authenticate_to_by_group", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="GROUP") self.add_option("--computer-allowed-to-authenticate-to-by-silo", help="Computer is allowed to authenticate to by silo.", type=str, dest="allowed_to_authenticate_to_by_silo", - action="callback", callback=self.set_option) + action="callback", callback=self.set_option, + metavar="SILO") class cmd_domain_auth_policy_list(Command): diff --git a/python/samba/netcmd/domain/auth/silo.py b/python/samba/netcmd/domain/auth/silo.py index b1e2ef0a0ae..2e277610e8e 100644 --- a/python/samba/netcmd/domain/auth/silo.py +++ b/python/samba/netcmd/domain/auth/silo.py @@ -117,13 +117,16 @@ class cmd_domain_auth_silo_create(Command): dest="description", action="store", type=str), Option("--user-authentication-policy", help="User account authentication policy.", - dest="user_authentication_policy", action="store", type=str), + dest="user_authentication_policy", action="store", type=str, + metavar="USER_POLICY"), Option("--service-authentication-policy", help="Managed service account authentication policy.", - dest="service_authentication_policy", action="store", type=str), + dest="service_authentication_policy", action="store", type=str, + metavar="SERVICE_POLICY"), Option("--computer-authentication-policy", help="Computer authentication policy.", - dest="computer_authentication_policy", action="store", type=str), + dest="computer_authentication_policy", action="store", type=str, + metavar="COMPUTER_POLICY"), Option("--protect", help="Protect authentication silo from accidental deletion.", dest="protect", action="store_true"), @@ -231,13 +234,16 @@ class cmd_domain_auth_silo_modify(Command): dest="description", action="store", type=str), Option("--user-authentication-policy", help="User account authentication policy.", - dest="user_authentication_policy", action="store", type=str), + dest="user_authentication_policy", action="store", type=str, + metavar="USER_POLICY"), Option("--service-authentication-policy", help="Managed service account authentication policy.", - dest="service_authentication_policy", action="store", type=str), + dest="service_authentication_policy", action="store", type=str, + metavar="SERVICE_POLICY"), Option("--computer-authentication-policy", help="Computer authentication policy.", - dest="computer_authentication_policy", action="store", type=str), + dest="computer_authentication_policy", action="store", type=str, + metavar="COMPUTER_POLICY"), Option("--protect", help="Protect authentication silo from accidental deletion.", dest="protect", action="store_true"),