scripts: Use range instead of xrange

Change-Id: I15c1877fea6ae0bccdcd8b319941d7a30180fe8c
Signed-off-by: shahar salzman <shahar.salzman@kaminario.com>
Reviewed-on: https://review.gerrithub.io/c/444424
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
shahar salzman 2019-02-13 17:18:38 +02:00 committed by Jim Harris
parent e7121a262f
commit 77a55a2fc4

View File

@ -33,7 +33,7 @@ class SpdkArr(object):
self.element_type = element_type self.element_type = element_type
def __iter__(self): def __iter__(self):
for i in xrange(0, self.num_elements): for i in range(0, self.num_elements):
curr = (self.arr_pointer + i).dereference() curr = (self.arr_pointer + i).dereference()
if (curr == 0x0): if (curr == 0x0):
continue continue
@ -149,7 +149,7 @@ class NvmfSubsystem(SpdkObject):
def get_ns_list(self): def get_ns_list(self):
max_nsid = int(self.obj['max_nsid']) max_nsid = int(self.obj['max_nsid'])
ns_list = [] ns_list = []
for i in xrange(0, max_nsid): for i in range(0, max_nsid):
nsptr = (self.obj['ns'] + i).dereference() nsptr = (self.obj['ns'] + i).dereference()
if nsptr == 0x0: if nsptr == 0x0:
continue continue