From 66ea49130dd486e86aaa6df37d41dc3f27fdf772 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 9 Mar 2018 14:02:18 +0000 Subject: [PATCH] s4/torture/drs: convert print func to be py2/py3 compatible Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- source4/torture/drs/python/delete_object.py | 5 +- source4/torture/drs/python/drs_base.py | 13 ++--- source4/torture/drs/python/fsmo.py | 7 +-- source4/torture/drs/python/getncchanges.py | 1 + source4/torture/drs/python/repl_move.py | 35 +++++++------ source4/torture/drs/python/replica_sync.py | 57 +++++++++++---------- 6 files changed, 62 insertions(+), 56 deletions(-) diff --git a/source4/torture/drs/python/delete_object.py b/source4/torture/drs/python/delete_object.py index 620a44659e7..d37e7044384 100644 --- a/source4/torture/drs/python/delete_object.py +++ b/source4/torture/drs/python/delete_object.py @@ -26,6 +26,7 @@ # PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN delete_object -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD" # +from __future__ import print_function import time @@ -121,7 +122,7 @@ class DrsDeleteObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False) # trigger replication from DC1 to DC2 @@ -277,7 +278,7 @@ class DrsDeleteObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False) # trigger replication from DC1 to DC2 diff --git a/source4/torture/drs/python/drs_base.py b/source4/torture/drs/python/drs_base.py index 66a0d8d6d77..a6a2439c457 100644 --- a/source4/torture/drs/python/drs_base.py +++ b/source4/torture/drs/python/drs_base.py @@ -20,6 +20,7 @@ # along with this program. If not, see . # +from __future__ import print_function import sys import time import os @@ -511,19 +512,19 @@ class AbstractLink: """See CompareLinks() in MS-DRSR section 4.1.10.5.17""" if not isinstance(other, AbstractLink): if verbose: - print "AbstractLink.__internal_cmp__(%r, %r) => wrong type" % (self, other) + print("AbstractLink.__internal_cmp__(%r, %r) => wrong type" % (self, other)) return NotImplemented c = cmp(self.selfGUID_blob, other.selfGUID_blob) if c != 0: if verbose: - print "AbstractLink.__internal_cmp__(%r, %r) => %d different identifier" % (self, other, c) + print("AbstractLink.__internal_cmp__(%r, %r) => %d different identifier" % (self, other, c)) return c c = other.attid - self.attid if c != 0: if verbose: - print "AbstractLink.__internal_cmp__(%r, %r) => %d different attid" % (self, other, c) + print("AbstractLink.__internal_cmp__(%r, %r) => %d different attid" % (self, other, c)) return c self_active = self.flags & drsuapi.DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE @@ -532,19 +533,19 @@ class AbstractLink: c = self_active - other_active if c != 0: if verbose: - print "AbstractLink.__internal_cmp__(%r, %r) => %d different FLAG_ACTIVE" % (self, other, c) + print("AbstractLink.__internal_cmp__(%r, %r) => %d different FLAG_ACTIVE" % (self, other, c)) return c c = cmp(self.targetGUID_blob, other.targetGUID_blob) if c != 0: if verbose: - print "AbstractLink.__internal_cmp__(%r, %r) => %d different target" % (self, other, c) + print("AbstractLink.__internal_cmp__(%r, %r) => %d different target" % (self, other, c)) return c c = self.flags - other.flags if c != 0: if verbose: - print "AbstractLink.__internal_cmp__(%r, %r) => %d different flags" % (self, other, c) + print("AbstractLink.__internal_cmp__(%r, %r) => %d different flags" % (self, other, c)) return c return 0 diff --git a/source4/torture/drs/python/fsmo.py b/source4/torture/drs/python/fsmo.py index 50b7dc3b2c4..6be55f8b70c 100644 --- a/source4/torture/drs/python/fsmo.py +++ b/source4/torture/drs/python/fsmo.py @@ -25,6 +25,7 @@ # PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN fsmo -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD" # +from __future__ import print_function import sys import time import os @@ -98,7 +99,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase): """Triggers transfer of role from DC1 to DC2 and vice versa so the role goes back to the original dc""" # dc2 gets the role from dc1 - print "Testing for %s role transfer from %s to %s" % (role, self.dnsname_dc1, self.dnsname_dc2) + print("Testing for %s role transfer from %s to %s" % (role, self.dnsname_dc1, self.dnsname_dc2)) self._net_fsmo_role_transfer(DC=self.dnsname_dc2, role=role) # check if the role is transfered @@ -109,7 +110,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase): "Transferring %s role to %s has failed, master is: %s!"%(role, self.dsServiceName_dc2, master)) # dc1 gets back the role from dc2 - print "Testing for %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1) + print("Testing for %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1)) self._net_fsmo_role_transfer(DC=self.dnsname_dc1, role=role) # check if the role is transfered (res, master) = self._wait_for_role_transfer(ldb_dc=self.ldb_dc1, @@ -119,7 +120,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase): "Transferring %s role to %s has failed, master is: %s!"%(role, self.dsServiceName_dc1, master)) # dc1 keeps the role - print "Testing for no-op %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1) + print("Testing for no-op %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1)) self._net_fsmo_role_transfer(DC=self.dnsname_dc1, role=role, noop=True) # check if the role is transfered (res, master) = self._wait_for_role_transfer(ldb_dc=self.ldb_dc1, diff --git a/source4/torture/drs/python/getncchanges.py b/source4/torture/drs/python/getncchanges.py index b60ec533c9a..1b619f14692 100644 --- a/source4/torture/drs/python/getncchanges.py +++ b/source4/torture/drs/python/getncchanges.py @@ -27,6 +27,7 @@ # PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN getncchanges -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD" # +from __future__ import print_function import drs_base import samba.tests import ldb diff --git a/source4/torture/drs/python/repl_move.py b/source4/torture/drs/python/repl_move.py index 43a6caece82..dfb48415c6f 100644 --- a/source4/torture/drs/python/repl_move.py +++ b/source4/torture/drs/python/repl_move.py @@ -27,6 +27,7 @@ # PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN repl_move -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD" # +from __future__ import print_function import time import uuid @@ -275,7 +276,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) initial_metadata = [ (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1), (DRSUAPI_ATTID_cn, self.dc1_guid, 1), @@ -548,7 +549,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) initial_metadata = [ (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1), (DRSUAPI_ATTID_cn, self.dc1_guid, 1), @@ -730,7 +731,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) initial_metadata = [ (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1), (DRSUAPI_ATTID_cn, self.dc1_guid, 1), @@ -910,7 +911,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) initial_metadata = [ (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1), (DRSUAPI_ATTID_cn, self.dc1_guid, 1), @@ -1091,7 +1092,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) initial_metadata = [ (DRSUAPI_ATTID_objectClass, self.dc1_guid, 1), (DRSUAPI_ATTID_cn, self.dc1_guid, 1), @@ -1419,7 +1420,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): user_cur = self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False) # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False) new_dn = ldb.Dn(self.ldb_dc1, "CN=%s" % username) @@ -1480,7 +1481,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): ou_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False) # trigger replication from DC1 to DC2 @@ -1546,7 +1547,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): ou_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False) # trigger replication from DC1 to DC2 @@ -1612,7 +1613,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): ou_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False) # trigger replication from DC1 to DC2 @@ -1679,7 +1680,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): ou_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False) # trigger replication from DC1 to DC2 @@ -1745,7 +1746,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): ou_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False) # trigger replication from DC1 to DC2 @@ -1794,7 +1795,7 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): ou_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (self.ou1_dn, self._GUID_string(ou_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=ou_orig, is_deleted=False) # trigger replication from DC1 to DC2 @@ -1958,7 +1959,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False) self.ldb_dc1.add(self.ou2) @@ -2014,7 +2015,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False) self.ldb_dc1.add(self.ou2) @@ -2108,7 +2109,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False) self.ldb_dc1.add(self.ou2) @@ -2197,7 +2198,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False) self.ldb_dc1.add(self.ou2) @@ -2297,7 +2298,7 @@ class DrsMoveBetweenTreeOfObjectTestCase(drs_base.DrsBaseTestCase): user_dn = ldb_res[0]["dn"] # check user info on DC1 - print "Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0])) + print("Testing for %s with GUID %s" % (username, self._GUID_string(user_orig["objectGUID"][0]))) self._check_obj(sam_ldb=self.ldb_dc1, obj_orig=user_orig, is_deleted=False) self.ldb_dc1.add(self.ou2) diff --git a/source4/torture/drs/python/replica_sync.py b/source4/torture/drs/python/replica_sync.py index fe013e63259..c8a38333d24 100644 --- a/source4/torture/drs/python/replica_sync.py +++ b/source4/torture/drs/python/replica_sync.py @@ -27,6 +27,7 @@ # PYTHONPATH="$PYTHONPATH:$samba4srcdir/torture/drs/python" $SUBUNITRUN replica_sync -U"$DOMAIN/$DC_USERNAME"%"$DC_PASSWORD" # +from __future__ import print_function import drs_base import samba.tests import time @@ -155,8 +156,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc2.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertFalse('CNF:%s' % self.ou2 in str(res2[0]["name"][0])) self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0])) self.assertTrue(self._lost_and_found_dn(self.ldb_dc2, self.domain_dn) not in str(res1[0].dn)) @@ -195,8 +196,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0])) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn)) @@ -234,8 +235,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % self.ou2 in str(res2[0]["name"][0]), "Got %s for %s" % (str(res2[0]["name"][0]), self.ou2)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn)) @@ -276,8 +277,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0])) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn)) @@ -325,8 +326,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0])) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn)) @@ -364,8 +365,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % self.ou2 in str(res2[0]["name"][0])) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn)) @@ -407,8 +408,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0])) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn)) @@ -455,8 +456,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0])) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn)) @@ -506,8 +507,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % self.ou2 in str(res2[0]["name"][0])) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res1[0].dn)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) not in str(res2[0].dn)) @@ -558,8 +559,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % ou2_child, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % ou1_child in str(res1[0]["name"][0]) or 'CNF:%s' % ou2_child in str(res2[0]["name"][0])) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) in str(res1[0].dn)) self.assertTrue(self._lost_and_found_dn(self.ldb_dc1, self.domain_dn) in str(res2[0].dn)) @@ -625,9 +626,9 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res3 = self.ldb_dc2.search(base="" % ou3_child, scope=SCOPE_BASE, attrs=["name"]) - print res1[0].dn - print res2[0].dn - print res3[0].dn + print(res1[0].dn) + print(res2[0].dn) + print(res3[0].dn) self.assertEqual('Test Child 2', res1[0]["name"][0]) self.assertEqual('Test Child', res2[0]["name"][0]) self.assertEqual('Test CASE Child', res3[0]["name"][0]) @@ -645,9 +646,9 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res3 = self.ldb_dc1.search(base="" % ou3_child, scope=SCOPE_BASE, attrs=["name"]) - print res1[0].dn - print res2[0].dn - print res3[0].dn + print(res1[0].dn) + print(res2[0].dn) + print(res3[0].dn) self.assertEqual('Test Child 2', res1[0]["name"][0]) self.assertEqual('Test Child', res2[0]["name"][0]) self.assertEqual('Test CASE Child', res3[0]["name"][0]) @@ -723,8 +724,8 @@ objectClass: organizationalUnit scope=SCOPE_BASE, attrs=["name"]) res2 = self.ldb_dc1.search(base="" % self.ou2, scope=SCOPE_BASE, attrs=["name"]) - print res1[0]["name"][0] - print res2[0]["name"][0] + print(res1[0]["name"][0]) + print(res2[0]["name"][0]) self.assertTrue('CNF:%s' % self.ou1 in str(res1[0]["name"][0])) self.assertFalse('CNF:%s' % self.ou2 in str(res2[0]["name"][0])) -- 2.47.3