s4/torture/drs/python: use cmp_fn for cmp (for py2/py3 compat)
authorNoel Power <noel.power@suse.com>
Fri, 15 Jun 2018 12:06:13 +0000 (13:06 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Jul 2018 23:12:25 +0000 (01:12 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/torture/drs/python/drs_base.py

index c9518ef7358b31c72d0afaabe707a0ed69e6eb6c..91b76b3c6aa1d87863b992823291a9b0334e0eab 100644 (file)
@@ -39,7 +39,7 @@ from ldb import (
     Message,
     FLAG_MOD_REPLACE,
     )
-
+from samba.compat import cmp_fn
 
 class DrsBaseTestCase(SambaToolCmdTest):
     """Base class implementation for all DRS python tests.
@@ -515,7 +515,7 @@ class AbstractLink:
                 print("AbstractLink.__internal_cmp__(%r, %r) => wrong type" % (self, other))
             return NotImplemented
 
-        c = cmp(self.selfGUID_blob, other.selfGUID_blob)
+        c = cmp_fn(self.selfGUID_blob, other.selfGUID_blob)
         if c != 0:
             if verbose:
                 print("AbstractLink.__internal_cmp__(%r, %r) => %d different identifier" % (self, other, c))
@@ -536,7 +536,7 @@ class AbstractLink:
                 print("AbstractLink.__internal_cmp__(%r, %r) => %d different FLAG_ACTIVE" % (self, other, c))
             return c
 
-        c = cmp(self.targetGUID_blob, other.targetGUID_blob)
+        c = cmp_fn(self.targetGUID_blob, other.targetGUID_blob)
         if c != 0:
             if verbose:
                 print("AbstractLink.__internal_cmp__(%r, %r) => %d different target" % (self, other, c))