← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1583419] Re: Make dict.keys() PY3 compatible

 

Hi All,

This issue is also present in nova, cinder and python-manilaclient as
well.

nova:
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/volumes.py#L71

cinder:
https://github.com/openstack/cinder/blob/master/cinder/backup/manager.py#L128

python-manilaclient:
https://github.com/openstack/python-manilaclient/blob/master/manilaclient/tests/functional/test_shares_metadata.py#L139

** Also affects: cinder
   Importance: Undecided
       Status: New

** Changed in: cinder
     Assignee: (unassigned) => Dinesh Bhor (dinesh-bhor)

** Also affects: python-manilaclient
   Importance: Undecided
       Status: New

** Changed in: python-manilaclient
     Assignee: (unassigned) => Dinesh Bhor (dinesh-bhor)

** Also affects: nova
   Importance: Undecided
       Status: New

** Changed in: nova
     Assignee: (unassigned) => Dinesh Bhor (dinesh-bhor)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1583419

Title:
  Make dict.keys() PY3 compatible

Status in Cinder:
  In Progress
Status in OpenStack Compute (nova):
  New
Status in python-cinderclient:
  Fix Released
Status in python-manilaclient:
  In Progress
Status in python-troveclient:
  New

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'

To manage notifications about this bug go to:
https://bugs.launchpad.net/cinder/+bug/1583419/+subscriptions