]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netcmd: auth: set better metavar that matches the docs
authorRob van der Linde <rob@catalyst.net.nz>
Thu, 23 Nov 2023 01:08:04 +0000 (14:08 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 27 Nov 2023 03:08:28 +0000 (03:08 +0000)
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/domain/auth/policy.py
python/samba/netcmd/domain/auth/silo.py

index 32a24adafee3ab9759389763d82343141155c074..ca4f6125cf406dbd483933ff37f7b7b8cd7734fc 100644 (file)
@@ -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):
index b1e2ef0a0aee799abf4c9ec65750a5c9bafa6114..2e277610e8e6ff8f576c5b9923e87ac8119866d7 100644 (file)
@@ -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"),