summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-09-23 17:39:24 +1000
committerAndrew Tridgell <tridge@samba.org>2011-10-04 15:08:56 +1100
commit2fbdaab331e5ba5ffb9ce2784c60cf99f84ad5b6 (patch)
treec80d27b3bb92d36cee3ba7b7e3bf42b67c09236f
parentaed0d2e5ebfa15a08f30dc1ebde584ad8722d055 (diff)
downloadsamba-2fbdaab331e5ba5ffb9ce2784c60cf99f84ad5b6.tar.gz
samba-2fbdaab331e5ba5ffb9ce2784c60cf99f84ad5b6.tar.bz2
samba-2fbdaab331e5ba5ffb9ce2784c60cf99f84ad5b6.zip
samba-tool: cope with GC compares in ldapcmp
the two base DNs do not need to match when doing GC replica compares
-rwxr-xr-xsource4/scripting/python/samba/netcmd/ldapcmp.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/netcmd/ldapcmp.py b/source4/scripting/python/samba/netcmd/ldapcmp.py
index 14e8492364..cd81aa33d8 100755
--- a/source4/scripting/python/samba/netcmd/ldapcmp.py
+++ b/source4/scripting/python/samba/netcmd/ldapcmp.py
@@ -817,9 +817,11 @@ class LDAPBundel(object):
self.search_scope = SCOPE_ONELEVEL
else:
raise StandardError("Wrong 'scope' given. Choose from: SUB, ONE, BASE")
- if not self.search_base.upper().endswith(search_base.upper()):
- raise StandardError("Invalid search base specified: %s" % self.search_base)
- res = self.con.ldb.search(base=self.search_base, scope=self.search_scope, attrs=["dn"])
+ try:
+ res = self.con.ldb.search(base=self.search_base, scope=self.search_scope, attrs=["dn"])
+ except LdbError, (enum, estr):
+ print("Failed search of base=%s" % self.search_base)
+ raise
for x in res:
dn_list.append(x["dn"].get_linearized())
#