Make dict.keys() PY3 compatible

Bug #1583419 reported by xiexs
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Dinesh Bhor
Rally
Fix Released
Undecided
Yafei Yu
networking-l2gw
Fix Released
Undecided
qinchunhua
neutron
Fix Released
Undecided
Bin Zhou
python-cinderclient
Fix Released
Undecided
xiexs
python-manilaclient
Fix Released
Undecided
Dinesh Bhor
python-troveclient
Fix Released
Undecided
Dinesh Bhor
tacker
Fix Released
Undecided
qinchunhua
watcher
Fix Released
Undecided
weiweigu

Bug Description

In PY3, dict.keys() will return a view of list but not a list anymore, i.e.
$ python3.4
Python 3.4.3 (default, Mar 31 2016, 20:42:37)
>>> body={"11":"22"}
>>> body[body.keys()[0]]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'dict_keys' object does not support indexing

so for py3 compatible we should change it as follows:
>>> body[list(body.keys())[0]]
'22'

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

Reviewed: https://review.openstack.org/293388
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=219c334f0169fe485b05bb9e5ae99edd9685dfb1
Submitter: Jenkins
Branch: master

commit 219c334f0169fe485b05bb9e5ae99edd9685dfb1
Author: xiexs <email address hidden>
Date: Thu May 19 00:11:50 2016 -0400

    Make dict.keys() PY3 compatible

    The dict.keys()[0] will raise a TypeError in PY3,
    as dict.keys() doesn't return a list any more in PY3
    but a view of list.

    Change-Id: Ia6c0783ca8c8514a06defbeed0fa9ef24bbd9d4a
    Closes-Bug: #1583419

Changed in python-cinderclient:
status: In Progress → Fix Released
Revision history for this message
Dinesh Bhor (dinesh-bhor) wrote :
Changed in python-troveclient:
assignee: nobody → Dinesh Bhor (dinesh-bhor)
Changed in cinder:
assignee: nobody → Dinesh Bhor (dinesh-bhor)
Changed in python-manilaclient:
assignee: nobody → Dinesh Bhor (dinesh-bhor)
Changed in nova:
assignee: nobody → Dinesh Bhor (dinesh-bhor)
Revision history for this message
Dinesh Bhor (dinesh-bhor) wrote :
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/332099

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

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

Changed in python-troveclient:
status: New → In Progress
Changed in python-troveclient:
assignee: Dinesh Bhor (dinesh-bhor) → Peter Stachowski (peterstac)
Changed in python-troveclient:
assignee: Peter Stachowski (peterstac) → Dinesh Bhor (dinesh-bhor)
Yafei Yu (yu-yafei)
Changed in rally:
assignee: nobody → yuyafei (yu-yafei)
Bin Zhou (binzhou)
Changed in neutron:
assignee: nobody → Bin Zhou (binzhou)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to rally (master)

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

Changed in rally:
status: New → In Progress
liuwei (liu-wei81)
Changed in ceilometer:
assignee: nobody → liuwei (liu-wei81)
Changed in heat:
assignee: nobody → liuwei (liu-wei81)
liuwei (liu-wei81)
Changed in python-ceilometerclient:
assignee: nobody → liuwei (liu-wei81)
Changed in python-heatclient:
assignee: nobody → liuwei (liu-wei81)
liuwei (liu-wei81)
Changed in ceilometer:
status: New → In Progress
Ji.Wei (jiwei)
Changed in python-glanceclient:
assignee: nobody → Ji.Wei (jiwei)
Ji.Wei (jiwei)
Changed in tempest:
assignee: nobody → Ji.Wei (jiwei)
Thomas Herve (therve)
no longer affects: heat
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/332661

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

Reviewed: https://review.openstack.org/332593
Committed: https://git.openstack.org/cgit/openstack/rally/commit/?id=0b7c9f4f991fbdc1c5cc2f3f50dc24ee9a6ac59d
Submitter: Jenkins
Branch: master

commit 0b7c9f4f991fbdc1c5cc2f3f50dc24ee9a6ac59d
Author: yuyafei <email address hidden>
Date: Wed Jun 22 10:27:49 2016 +0800

    Make dict.keys() PY3 compatible

    The dict.keys()[0] will raise a TypeError in PY3, as dict.keys()
    doesn't return a list any more in PY3 but a view of list.

    Change-Id: I0a7a1fbbcd8394dbe100a50b23126897c2da3865
    Closes-Bug: #1583419

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

Reviewed: https://review.openstack.org/332081
Committed: https://git.openstack.org/cgit/openstack/python-troveclient/commit/?id=dabe872cbcfd815c63fe5816858923b1e908eefe
Submitter: Jenkins
Branch: master

commit dabe872cbcfd815c63fe5816858923b1e908eefe
Author: dineshbhor <email address hidden>
Date: Tue Jun 21 16:15:41 2016 +0530

    Make dict.keys() PY3 compatible

    The dict.keys()[0] will raise a TypeError in PY3,
    as dict.keys() doesn't return a list any more in PY3
    but a view of list.

    Change-Id: Id9c7d3725c01bd0a193d8fc6705443efe9c25c34
    Partially implements: blueprint trove-python3
    Closes-Bug: #1583419

Changed in python-troveclient:
status: In Progress → Fix Released
no longer affects: nova
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

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

Changed in tempest:
status: New → In Progress
liuwei (liu-wei81)
no longer affects: ceilometer
no longer affects: python-ceilometerclient
no longer affects: python-heatclient
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/332099
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=c25998ee429ca796e8b15f3800a775ccdc5ab029
Submitter: Jenkins
Branch: master

commit c25998ee429ca796e8b15f3800a775ccdc5ab029
Author: dineshbhor <email address hidden>
Date: Tue Jun 21 14:49:34 2016 +0530

    Make dict.keys() PY3 compatible

    The dict.keys()[0] will raise a TypeError in PY3,
    as dict.keys() doesn't return a list any more in PY3
    but a view of list.

    Closes-Bug: #1583419
    Change-Id: I8e05cf4d68568f9446f752418277764c2ce94ff4

Changed in cinder:
status: In Progress → Fix Released
Ji.Wei (jiwei)
no longer affects: python-glanceclient
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-manilaclient (master)

Reviewed: https://review.openstack.org/332101
Committed: https://git.openstack.org/cgit/openstack/python-manilaclient/commit/?id=1e9ba407837648d428e5ac0b4cba46dea7f46e39
Submitter: Jenkins
Branch: master

commit 1e9ba407837648d428e5ac0b4cba46dea7f46e39
Author: dineshbhor <email address hidden>
Date: Tue Jun 21 17:00:13 2016 +0530

    Make dict.keys() PY3 compatible

    The dict.keys()[0] will raise a TypeError in PY3,
    as dict.keys() doesn't return a list any more in PY3
    but a view of list.

    Change-Id: I5d8dead560acd897213e785d6eb0bc75a584af1b
    Closes-Bug: #1583419

Changed in python-manilaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tempest (master)

Change abandoned by JiWei (<email address hidden>) on branch: master
Review: https://review.openstack.org/333169

Changed in tacker:
assignee: nobody → Yan Songming (songmingyan)
status: New → Incomplete
affects: tacker → python-novaclient
Changed in python-novaclient:
status: Incomplete → In Progress
no longer affects: python-novaclient
Changed in neutron:
assignee: Bin Zhou (binzhou) → QunyingRan (ran-qunying)
qinchunhua (qin-chunhua)
Changed in tacker:
assignee: nobody → qinchunhua (qin-chunhua)
status: New → In Progress
Bin Zhou (binzhou)
Changed in neutron:
assignee: QunyingRan (ran-qunying) → Bin Zhou (binzhou)
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-troveclient 2.3.0

This issue was fixed in the openstack/python-troveclient 2.3.0 release.

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

Reviewed: https://review.openstack.org/337440
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=df7c0dad5ba45bc5122ebc2fe2aa3f4330d57a55
Submitter: Jenkins
Branch: master

commit df7c0dad5ba45bc5122ebc2fe2aa3f4330d57a55
Author: qinchunhua <email address hidden>
Date: Tue Jul 5 02:01:20 2016 -0400

    Fix dict.keys() PY3 compatible

    The dict.keys()[0] will raise a TypeError in PY3,
    as dict.keys() doesn't return a list any more in PY3
    but a view of list.

    Change-Id: I99514d57cb21bf65a59eb36b556248b9494246c7
    Closes-Bug: #1583419

Changed in tacker:
status: In Progress → Fix Released
Ji.Wei (jiwei)
no longer affects: tempest
weiweigu (gu-weiwei)
Changed in watcher:
assignee: nobody → weiweigu (gu-weiwei)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to watcher (master)

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

Changed in watcher:
status: New → In Progress
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/cinder 9.0.0.0b2

This issue was fixed in the openstack/cinder 9.0.0.0b2 development milestone.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-manilaclient 1.10.0

This issue was fixed in the openstack/python-manilaclient 1.10.0 release.

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

Reviewed: https://review.openstack.org/332661
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=31ed226a67ff6b2320f605ce436658312cf0c701
Submitter: Jenkins
Branch: master

commit 31ed226a67ff6b2320f605ce436658312cf0c701
Author: Bin Zhou <email address hidden>
Date: Wed Jun 22 16:35:12 2016 +0800

    Refactor usage of dict.values()[0]

    The dict.values()[0] will raise a TypeError in PY3, as dict.values()
    doesn't return a list any more in PY3 but a view of list. This patch
    is to fix this bug by refactoring the relevant code.

    Change-Id: I4362a22322807eda8d795d68395445d53ab60ad4
    Closes-Bug: #1583419

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

Reviewed: https://review.openstack.org/341946
Committed: https://git.openstack.org/cgit/openstack/watcher/commit/?id=cd60336e209e8900d28e06c167977ba21a07038c
Submitter: Jenkins
Branch: master

commit cd60336e209e8900d28e06c167977ba21a07038c
Author: weiweigu <email address hidden>
Date: Thu Jul 14 13:45:47 2016 +0800

    Fix dict.keys() PY3 compatible

    The dict.keys()[0] will raise a TypeError in PY3,
    as dict.keys() doesn't return a list any more in PY3
    but a view of list.

    Change-Id: If15a153c9db9b654e761f8ad50d5d66a427efa4e
    Closes-Bug: #1583419

Changed in watcher:
status: In Progress → Fix Released
tags: added: neutron-proactive-backport-potential
qinchunhua (qin-chunhua)
Changed in networking-l2gw:
status: New → Fix Released
assignee: nobody → qinchunhua (qin-chunhua)
Revision history for this message
Akihiro Motoki (amotoki) wrote :

networking-l2gw patch is https://review.openstack.org/343509.
It seems the patch has been merged before networking-l2gw was added to the affected project :-(

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/tacker 0.4.0

This issue was fixed in the openstack/tacker 0.4.0 release.

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/watcher 0.29.0

This issue was fixed in the openstack/watcher 0.29.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 9.0.0.0b3

This issue was fixed in the openstack/neutron 9.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cinderclient 1.9.0

This issue was fixed in the openstack/python-cinderclient 1.9.0 release.

tags: removed: neutron-proactive-backport-potential
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.