range method is not same in py3.x and py2.x

Bug #1268439 reported by lizheming
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Low
lizheming
Cinder
Fix Released
Low
Yuriy Nesenenko
Glance
Fix Released
Low
lizheming
OpenStack Heat
Fix Released
Low
lizheming
OpenStack Identity (keystone)
Invalid
Low
lizheming
OpenStack Object Storage (swift)
Invalid
Undecided
Unassigned
kolla
Fix Released
Undecided
Md Nadeem
neutron
Fix Released
Low
lizheming
python-ceilometerclient
Fix Released
Low
Kui Shi
python-neutronclient
Invalid
Undecided
Unassigned
python-swiftclient
Fix Released
Undecided
Unassigned

Bug Description

in py3.x,range is xrange in py2.x.
in py3.x, if you want get a list,you must use:
list(range(value))

I review the code, find that many codes use range for loop, if used py3.x environment,
it will occure error.
so we must modify this issue.

Tags: python3
lizheming (lizheming-li)
Changed in glance:
assignee: nobody → lizheming (lizheming-li)
Changed in nova:
assignee: nobody → lizheming (lizheming-li)
Changed in ceilometer:
assignee: nobody → lizheming (lizheming-li)
Changed in cinder:
assignee: nobody → lizheming (lizheming-li)
Changed in keystone:
assignee: nobody → lizheming (lizheming-li)
Changed in neutron:
assignee: nobody → lizheming (lizheming-li)
Changed in neutron:
status: New → Incomplete
status: Incomplete → Confirmed
importance: Undecided → Low
Feilong Wang (flwang)
Changed in glance:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/67364

Changed in glance:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/67382

Changed in neutron:
status: Confirmed → In Progress
lizheming (lizheming-li)
Changed in heat:
assignee: nobody → lizheming (lizheming-li)
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Thanks for tackling this. Hopefully eventlet will get py3.x support and then OpenStack can start moving forward with the py3k effort for services.

Changed in heat:
status: New → Triaged
importance: Undecided → Low
ZhiQiang Fan (aji-zqfan)
Changed in python-heatclient:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
ZhiQiang Fan (aji-zqfan)
no longer affects: python-heatclient
Changed in python-swiftclient:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
lizheming (lizheming-li)
Changed in python-neutronclient:
assignee: nobody → lizheming (lizheming-li)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/67612

Changed in python-neutronclient:
assignee: lizheming (lizheming-li) → ZhiQiang Fan (aji-zqfan)
status: New → In Progress
lizheming (lizheming-li)
Changed in ceilometer:
status: New → In Progress
Changed in heat:
status: Triaged → In Progress
lizheming (lizheming-li)
Changed in cinder:
status: New → In Progress
Changed in keystone:
status: New → In Progress
Changed in nova:
status: New → In Progress
ZhiQiang Fan (aji-zqfan)
Changed in python-neutronclient:
assignee: ZhiQiang Fan (aji-zqfan) → nobody
status: In Progress → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/67635

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/67638

Lee Li (lilinguo)
Changed in python-heatclient:
assignee: nobody → Lee Li (lilinguo)
Changed in python-keystoneclient:
assignee: nobody → Lee Li (lilinguo)
lizheming (lizheming-li)
Changed in python-ceilometerclient:
assignee: nobody → lizheming (lizheming-li)
status: New → In Progress
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-heatclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/67769

Changed in python-heatclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/67770

Changed in python-keystoneclient:
status: New → In Progress
Revision history for this message
lizheming (lizheming-li) wrote :

in keystone, it have no this isuuse.

Changed in swift:
assignee: nobody → lizheming (lizheming-li)
status: New → In Progress
Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

swiftclient fixed by: https://review.openstack.org/#/c/62850
Replace xrange in for loop with range

Changed in python-swiftclient:
assignee: ZhiQiang Fan (aji-zqfan) → nobody
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/67364
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=56089303f0c6c587ecf57544877b20ed3d9b477f
Submitter: Jenkins
Branch: master

commit 56089303f0c6c587ecf57544877b20ed3d9b477f
Author: lizheming <email address hidden>
Date: Fri Jan 17 11:21:38 2014 +0800

    fix bug:range() is not same in py3.x and py2.x

    in python3.x, there is no method named xrange(),it
    has replaced by range(),which is equal to xrange() in
    python2.x. so we must fix this issue.we use six module
    to fix this issue.

    Change-Id: If4fd7478865e8024025af3e57e42f2a24e1e2bbc
    Closes-Bug: #1268439

Changed in glance:
status: In Progress → Fix Committed
Changed in python-heatclient:
importance: Undecided → Medium
milestone: none → v0.2.7
no longer affects: python-heatclient
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
milestone: none → icehouse-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/67638
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=59b976fc7b13ebe8fece761e4581818b8bafe36f
Submitter: Jenkins
Branch: master

commit 59b976fc7b13ebe8fece761e4581818b8bafe36f
Author: lizheming <email address hidden>
Date: Sat Jan 18 14:48:31 2014 +0800

    Use six.move.xrange to replace xrange

    in python3.x, there is no method named xrange(),
    it has been replaced by range(),which is equal to xrange()
    in python2.x. so we must fix this issue.
    we use six module to fix this issue.

    Change-Id: Ia901798cf16b9a48982e6845fa3e5deffc3bd509
    Closes-Bug: #1268439

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/67382
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=42683e17842fca91e8b6aecde08b726a3b24cda8
Submitter: Jenkins
Branch: master

commit 42683e17842fca91e8b6aecde08b726a3b24cda8
Author: lizheming <email address hidden>
Date: Fri Jan 17 11:58:42 2014 +0800

    Fix bug:range() is not same in py3.x and py2.x

    in python3.x, there is no method named xrange(),
    it has replaced by range(),which is equal to xrange() in python2.x.
    so we must fix this issue.we use six module to fix this issue.

    Change-Id: I9cee3f0df2d8abbf6f66d7c5a3a0fed98df622e8
    Closes-Bug: #1268439

Changed in neutron:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in neutron:
milestone: none → icehouse-rc1
Thierry Carrez (ttx)
Changed in heat:
milestone: none → icehouse-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Revision history for this message
gordon chung (chungg) wrote :

fix committed in ceilometer: https://review.openstack.org/#/c/67635/

Changed in ceilometer:
importance: Undecided → Low
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-rc1 → 2014.1
Thierry Carrez (ttx)
Changed in glance:
milestone: icehouse-3 → 2014.1
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-rc1 → 2014.1
gordon chung (chungg)
Changed in python-ceilometerclient:
assignee: lizheming (lizheming-li) → Kui Shi (skuicloud)
importance: Undecided → Low
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → juno-1
status: Fix Committed → Fix Released
Sean Dague (sdague)
tags: added: python3
Revision history for this message
Duncan Thomas (duncan-thomas) wrote :

In the case of cinder (and I guess other projects too, but I only really follow cinder) we keep adding more and more ugly python 3 compatibility fixes, but we still can't actually run on python 3, so all we've gained is ugly code. We discussed at the mid-cycle meetup forcing the python3 work out-of-tree until it actually works and has CI, then fixing up the main tree in a clean series of patches derived from that tree. I'll put something on the -dev mailing list...

no longer affects: python-keystoneclient
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: juno-1 → 2014.2
Revision history for this message
Sean Dague (sdague) wrote :

Agreed for the Nova case. No additional python3 fixes are welcomed until there is a core eventlet and other library story.

no longer affects: nova
Changed in python-ceilometerclient:
status: Fix Committed → Fix Released
Changed in python-swiftclient:
status: Fix Committed → Fix Released
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

Automatically unassigning due to inactivity.

Changed in cinder:
assignee: lizheming (lizheming-li) → nobody
status: In Progress → Triaged
Changed in keystone:
status: In Progress → Invalid
Changed in cinder:
assignee: nobody → Yuriy Nesenenko (ynesenenko)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/267656

Changed in cinder:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lbaas (master)

Fix proposed to branch: master
Review: https://review.openstack.org/267963

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Yuriy Nesenenko (<email address hidden>) on branch: master
Review: https://review.openstack.org/267656
Reason: The strange duplication with https://review.openstack.org/#/c/268059/

Revision history for this message
Gorka Eguileor (gorka) wrote :

Fix released as LP bug 1530249

Changed in cinder:
status: In Progress → Fix Released
Changed in kolla:
assignee: nobody → MD NADEEM (mail2nadeem92)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

Fix proposed to branch: master
Review: https://review.openstack.org/270619

Changed in kolla:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (master)

Reviewed: https://review.openstack.org/270619
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=4f462ed451f09422a331f68f7fde0cf6a27d8fc0
Submitter: Jenkins
Branch: master

commit 4f462ed451f09422a331f68f7fde0cf6a27d8fc0
Author: MD NADEEM <email address hidden>
Date: Thu Jan 21 12:01:55 2016 +0530

    Fix bug:xrange() issue with py3.x

    In python3.x, there is no method named xrange(),
    it has replaced by range(),which is equal to xrange()
    in python2.x. so we must fix this issue.

    Closes-Bug: #1268439

    Change-Id: I66f0a7f248ad77bf06e96ea7cfcb7ef5f050b13a

Changed in kolla:
status: In Progress → Fix Released
Changed in cinder:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron-lbaas (master)

Change abandoned by Reedip (<email address hidden>) on branch: master
Review: https://review.openstack.org/267963
Reason: Hi Cedric, thanks for your review.
However, I do think we need this anymore.
range() works well in both PY2 and PY3.
If you think we still need this, let me know. Thanks

Revision history for this message
Tim Burke (1-tim-z) wrote :

Closing for Swift. We've cleaned up our use of xrange (see bug 1262147), but I think to run down all the places that we expect/require the result to be a list, we'll need to actually have python3 support (see bug 1691075 and bug 1667579).

Changed in swift:
assignee: lizheming (lizheming-li) → nobody
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.