TypeError: 'dict_keys' object does not support indexing

Bug #1819935 reported by dharmendra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
High
dharmendra

Bug Description

In py3 dict.keys() returns a dict_keys object which behaves a lot more like a set than a list.

Please see the bellow error logs:

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b' File "/home/ubuntu/tacker/.tox/py35/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched'
    b' return func(*args, **keywargs)'
    b' File "/home/ubuntu/tacker/tacker/tests/unit/vnfm/test_plugin.py", line 898, in test_create_vnf_trigger_respawn'
    b' action_value="respawn")'
    b' File "/home/ubuntu/tacker/.tox/py35/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched'
    b' return func(*args, **keywargs)'
    b' File "/home/ubuntu/tacker/tacker/tests/unit/vnfm/test_plugin.py", line 889, in _test_create_vnf_trigger'
    b' vnf_id, trigger_request)'
    b' File "/home/ubuntu/tacker/tacker/vnfm/plugin.py", line 946, in create_vnf_trigger'
    b' context, vnf_id, trigger_)'
    b' File "/home/ubuntu/tacker/tacker/vnfm/plugin.py", line 832, in _validate_alarming_policy'
    b" if trigger['trigger'].keys()[0]\\"
    b"TypeError: 'dict_keys' object does not support indexing"

Changed in tacker:
assignee: nobody → dharmendra (dharmendra-kushwaha)
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

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

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

Reviewed: https://review.openstack.org/643089
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=9ae59eec9e3e471998cb906c9d00404524eea7ad
Submitter: Zuul
Branch: master

commit 9ae59eec9e3e471998cb906c9d00404524eea7ad
Author: dharmendra <email address hidden>
Date: Wed Mar 13 16:00:25 2019 +0000

    Fix dict.keys() TypeError issue.

    In python3, dict.keys() returns a dict_keys object rather than
    a list. This patch will make it compatible with py3 as well as py2.

    Change-Id: I889c45fa57603f264f941e0025dc9232c370f1b0
    Closes-Bug: #1819935

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 1.0.0.0rc1

This issue was fixed in the openstack/tacker 1.0.0.0rc1 release candidate.

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.