diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-08-12 15:23:56 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-09-01 11:42:01 +0200 |
commit | 5178e9a5975b17683a2529f6cf4c903766d234d9 (patch) | |
tree | d51ad5a191cf5129024d182b9e5a1d2518151284 /ipaserver/install/cainstance.py | |
parent | 9e917cae39e266fb3092e5ab212a99968de996c2 (diff) | |
download | freeipa-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 'ipaserver/install/cainstance.py')
-rw-r--r-- | ipaserver/install/cainstance.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py index da1c72acb..6f565dd14 100644 --- a/ipaserver/install/cainstance.py +++ b/ipaserver/install/cainstance.py @@ -806,8 +806,8 @@ class CAInstance(DogtagInstance): chain = chain.split("\n") root_nickname=[] - for i in xrange(len(chain)): - m = re.match('\ *"(.*)" \[.*', chain[i]) + for part in chain: + m = re.match('\ *"(.*)" \[.*', part) if m: nick = m.groups(0)[0] if nick != "ipa-ca-agent" and nick[:7] != "Builtin": |