From 263f02078471a29cad97889a28c02db4ea06a422 Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Mon, 29 Oct 2018 11:54:57 +1300 Subject: netcmd/ldapcmp: add choices arg to --scope 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(-) (limited to 'python') diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py index 59991a6c956..01739f90f85 100644 --- a/python/samba/netcmd/ldapcmp.py +++ b/python/samba/netcmd/ldapcmp.py @@ -911,7 +911,7 @@ class cmd_ldapcmp(Command): help="Pass search base that will build DN list for the first DC."), Option("--base2", dest="base2", default="", help="Pass search base that will build DN list for the second DC. Used when --two or when compare two different DNs."), - Option("--scope", dest="scope", default="SUB", + Option("--scope", dest="scope", default="SUB", choices=["SUB", "ONE", "BASE"], help="Pass search scope that builds DN list. Options: SUB, ONE, BASE"), Option("--filter", dest="filter", default="", help="List of comma separated attributes to ignore in the comparision"), @@ -966,8 +966,6 @@ class cmd_ldapcmp(Command): 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") - if not scope.upper() in ["SUB", "ONE", "BASE"]: - raise CommandError("Invalid --scope value. Choose from: SUB, ONE, BASE") con1 = LDAPBase(URL1, creds, lp, two=two, quiet=quiet, descriptor=descriptor, sort_aces=sort_aces, -- cgit v1.2.1