summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJoe Guo <joeg@catalyst.net.nz>2018-10-29 11:54:57 +1300
committerAndrew Bartlett <abartlet@samba.org>2018-11-21 07:46:18 +0100
commit263f02078471a29cad97889a28c02db4ea06a422 (patch)
treeac15a43e992660f1392e795eb68cf1e52570edfc /python
parent683342b7a000f370cdc7456ce51cfb69783ced58 (diff)
downloadsamba-263f02078471a29cad97889a28c02db4ea06a422.tar.gz
netcmd/ldapcmp: add choices arg to --scope option
So we don't need to validate ourselves. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/netcmd/ldapcmp.py4
1 files changed, 1 insertions, 3 deletions
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,