summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-08-12 15:23:56 +0200
committerJan Cholasta <jcholast@redhat.com>2015-09-01 11:42:01 +0200
commit5178e9a5975b17683a2529f6cf4c903766d234d9 (patch)
treed51ad5a191cf5129024d182b9e5a1d2518151284 /ipapython
parent9e917cae39e266fb3092e5ab212a99968de996c2 (diff)
downloadfreeipa-5178e9a5975b17683a2529f6cf4c903766d234d9.tar.gz
freeipa-5178e9a5975b17683a2529f6cf4c903766d234d9.tar.xz
freeipa-5178e9a5975b17683a2529f6cf4c903766d234d9.zip
Modernize use of range()
In Python 3, range() behaves like the old xrange(). The difference between range() and xrange() is usually not significant, especially if the whole result is iterated over. Convert xrange() usage to range() for small ranges. Use modern idioms in a few other uses of range(). Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/p11helper.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipapython/p11helper.py b/ipapython/p11helper.py
index 82e7bff19..10a60cc02 100644
--- a/ipapython/p11helper.py
+++ b/ipapython/p11helper.py
@@ -13,7 +13,7 @@ def generate_master_key(p11, keylabel=u"dnssec-master", key_length=16,
while True:
# check if key with this ID exist in LDAP or softHSM
# id is 16 Bytes long
- key_id = "".join(chr(random.randint(0, 255)) for _ in xrange(0, 16))
+ key_id = "".join(chr(random.randint(0, 255)) for _ in range(0, 16))
keys = p11.find_keys(_ipap11helper.KEY_CLASS_SECRET_KEY,
label=keylabel,
id=key_id)