samba_tool: replace xrange -> range
authorNoel Power <noel.power@suse.com>
Fri, 4 May 2018 11:19:57 +0000 (12:19 +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>
python/samba/netcmd/dns.py
python/samba/netcmd/user.py

index 8bd6a9bf8a0a58495b3beb88cd5c1a6c4b2576da..a0e92cf8dd9090cb18ba48062d490cd1124b17ce 100644 (file)
@@ -140,7 +140,7 @@ def ip4_array_string(array):
     ret = []
     if not array:
         return ret
-    for i in xrange(array.AddrCount):
+    for i in range(array.AddrCount):
         addr = inet_ntop(AF_INET, pack('I', array.AddrArray[i]))
         ret.append(addr)
     return ret
@@ -150,7 +150,7 @@ def dns_addr_array_string(array):
     ret = []
     if not array:
         return ret
-    for i in xrange(array.AddrCount):
+    for i in range(array.AddrCount):
         if array.AddrArray[i].MaxSa[0] == 0x02:
             x = "".join([chr(b) for b in array.AddrArray[i].MaxSa])[4:8]
             addr = inet_ntop(AF_INET, x)
@@ -523,7 +523,7 @@ def dns_record_match(dns_conn, server, zone, name, record_type, data):
         elif record_type == dnsp.DNS_TYPE_TXT:
             if rec.data.count == urec.data.count:
                 found = True
-                for i in xrange(rec.data.count):
+                for i in range(rec.data.count):
                     found = found and \
                             (rec.data.str[i].str == urec.data.str[i].str)
 
index f849e6ee837fd9cd3e35572bca82d64e37a70188..bfe2684e93887de329c074487085b49943562c4f 100644 (file)
@@ -2027,7 +2027,7 @@ samba-tool user syncpasswords --terminate \\
             if self.lockfd != -1:
                 got_exclusive = False
                 # Try 5 times to get the exclusiv lock.
-                for i in xrange(0, 5):
+                for i in range(0, 5):
                     try:
                         fcntl.lockf(self.lockfd, fcntl.LOCK_EX | fcntl.LOCK_NB)
                         got_exclusive = True