From e71d0d71203474b1b30c8c8250c28ba4889b1f20 Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Mon, 29 Oct 2018 12:12:38 +1300 Subject: [PATCH] netcmd/ldapcmp: add choices arg to --view option So we don't need to validate ourselves. Signed-off-by: Joe Guo Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- python/samba/netcmd/ldapcmp.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py index 01739f90f85..9bfa8531e81 100644 --- a/python/samba/netcmd/ldapcmp.py +++ b/python/samba/netcmd/ldapcmp.py @@ -905,7 +905,7 @@ class cmd_ldapcmp(Command): help="Compare nTSecurityDescriptor attibutes only"), Option("--sort-aces", dest="sort_aces", action="store_true", default=False, help="Sort ACEs before comparison of nTSecurityDescriptor attribute"), - Option("--view", dest="view", default="section", + Option("--view", dest="view", default="section", choices=["section", "collision"], help="Display mode for nTSecurityDescriptor results. Possible values: section or collision."), Option("--base", dest="base", default="", help="Pass search base that will build DN list for the first DC."), @@ -964,8 +964,6 @@ class cmd_ldapcmp(Command): raise CommandError("You cannot set --verbose and --quiet together") if (not base and base2) or (base and not base2): raise CommandError("You need to specify both --base and --base2 at the same time") - if descriptor and view.upper() not in ["SECTION", "COLLISION"]: - raise CommandError("Invalid --view value. Choose from: section or collision") con1 = LDAPBase(URL1, creds, lp, two=two, quiet=quiet, descriptor=descriptor, sort_aces=sort_aces, -- 2.47.2