samba-tool: cope with GC compares in ldapcmp
authorAndrew Tridgell <tridge@samba.org>
Fri, 23 Sep 2011 07:39:24 +0000 (17:39 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 4 Oct 2011 04:08:56 +0000 (15:08 +1100)
the two base DNs do not need to match when doing GC replica compares

source4/scripting/python/samba/netcmd/ldapcmp.py

index 14e8492364808dd4941004f81a0922862c132492..cd81aa33d861a255f8b5461fa72f761fbc91016c 100755 (executable)
@@ -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())
         #