From: Joe Guo Date: Mon, 29 Oct 2018 01:49:28 +0000 (+1300) Subject: netcmd/ldapcmp: rename __eq__ to diff X-Git-Tag: tdb-1.3.17~701 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=683342b7a000f370cdc7456ce51cfb69783ced58;p=thirdparty%2Fsamba.git netcmd/ldapcmp: rename __eq__ to diff 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 Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py index bccf6c799c2..59991a6c956 100644 --- a/python/samba/netcmd/ldapcmp.py +++ b/python/samba/netcmd/ldapcmp.py @@ -740,7 +740,7 @@ class LDAPBundle(object): 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)) @@ -993,7 +993,7 @@ class cmd_ldapcmp(Command): 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)