From 2fbdaab331e5ba5ffb9ce2784c60cf99f84ad5b6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 23 Sep 2011 17:39:24 +1000 Subject: samba-tool: cope with GC compares in ldapcmp the two base DNs do not need to match when doing GC replica compares --- source4/scripting/python/samba/netcmd/ldapcmp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source4') 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()) # -- cgit