netcmd/ldapcmp: rename __eq__ to diff
authorJoe Guo <joeg@catalyst.net.nz>
Mon, 29 Oct 2018 01:49:28 +0000 (14:49 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 21 Nov 2018 06:46:18 +0000 (07:46 +0100)
This method actually changed both objects and print info.
__eq__ is not a proper name and is not designed for this case.
Rename to diff.

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>
python/samba/netcmd/ldapcmp.py

index bccf6c799c2d9c10d047cff7a0fbb46bc4ef5326..59991a6c956bc2a2baf8bb23b8e2a2f6fc523c41 100644 (file)
@@ -740,7 +740,7 @@ class LDAPBundle(object):
         self.size = len(self.dn_list)
         self.dn_list = sorted(self.dn_list)
 
         self.size = len(self.dn_list)
         self.dn_list = sorted(self.dn_list)
 
-    def __eq__(self, other):
+    def diff(self, other):
         res = True
         if self.size != other.size:
             self.log("\n* DN lists have different size: %s != %s" % (self.size, other.size))
         res = True
         if self.size != other.size:
             self.log("\n* DN lists have different size: %s != %s" % (self.size, other.size))
@@ -993,7 +993,7 @@ class cmd_ldapcmp(Command):
             b2 = LDAPBundle(con2, context=context, filter_list=filter_list,
                             outf=self.outf, errf=self.errf)
 
             b2 = LDAPBundle(con2, context=context, filter_list=filter_list,
                             outf=self.outf, errf=self.errf)
 
-            if b1 == b2:
+            if b1.diff(b2):
                 if not quiet:
                     self.outf.write("\n* Result for [%s]: SUCCESS\n" %
                                     context)
                 if not quiet:
                     self.outf.write("\n* Result for [%s]: SUCCESS\n" %
                                     context)