s4/dsdb/tests: py2/py3 compatability replace xrange with range
authorNoel Power <noel.power@suse.com>
Fri, 4 May 2018 11:18:59 +0000 (12:18 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 12 May 2018 19:38:17 +0000 (21:38 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/tests/python/notification.py
source4/dsdb/tests/python/sam.py

index a4456cb12c678101b0dc8967bdcd5b3d963bc5ad..e8ff9ddf1ac46d5c817c392b20a0a8c3871a65cb 100755 (executable)
@@ -163,7 +163,7 @@ delete: otherLoginWorkstations
         max_notifications = 5
 
         notifies = [None] * (max_notifications + 1)
-        for i in xrange(0, max_notifications + 1):
+        for i in range(0, max_notifications + 1):
             notifies[i] = self.ldb.search_iterator(base=self.base_dn,
                                                    expression="(objectClass=*)",
                                                    scope=ldb.SCOPE_SUBTREE,
@@ -172,7 +172,7 @@ delete: otherLoginWorkstations
                                                    timeout=1)
         num_admin_limit = 0
         num_time_limit = 0
-        for i in xrange(0, max_notifications + 1):
+        for i in range(0, max_notifications + 1):
             try:
                 for msg in notifies[i]:
                     continue
index b032d228b76e3ac024f698107d8498afb29b54f7..ec9bc90304b99dda236597042354ca41d32b5dd5 100755 (executable)
@@ -2536,7 +2536,7 @@ class SamTests(samba.tests.TestCase):
         delete_force(self.ldb, "cn=ldaptestcomputer,cn=computers," + self.base_dn)
 
     def find_repl_meta_data(self, rpmd, attid):
-        for i in xrange(0, rpmd.ctr.count):
+        for i in range(0, rpmd.ctr.count):
             m = rpmd.ctr.array[i]
             if m.attid == attid:
                 return m