Big Switch: keyerror on filtered get_ports call

Bug #1358668 reported by Kevin Benton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Kevin Benton
Icehouse
Fix Released
Medium
Kevin Benton

Bug Description

If get_ports is called in the Big Switch plugin without 'id' being one of the included fields, _extend_port_dict_binding will fail with the following error.

Traceback (most recent call last):
  File "neutron/tests/unit/bigswitch/test_restproxy_plugin.py", line 87, in test_get_ports_no_id
    context.get_admin_context(), fields=['name'])
  File "neutron/plugins/bigswitch/plugin.py", line 715, in get_ports
    self._extend_port_dict_binding(context, port)
  File "neutron/plugins/bigswitch/plugin.py", line 361, in _extend_port_dict_binding
    hostid = porttracker_db.get_port_hostid(context, port['id'])
KeyError: 'id'

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/115219

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
status: New → In Progress
Changed in neutron:
milestone: none → juno-rc1
importance: Undecided → Medium
tags: added: bigswitch
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/115219
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=295efa00081c770a57a5541652d9d3ffd5c1074d
Submitter: Jenkins
Branch: master

commit 295efa00081c770a57a5541652d9d3ffd5c1074d
Author: Kevin Benton <email address hidden>
Date: Mon Aug 18 21:49:31 2014 -0700

    Big Switch: Check for 'id' in port before lookup

    Check for the presence of the 'id' key before trying
    to do a lookup based on the value. This is necessary
    because a 'fields' param to get_port(s) may exclude
    the 'id' field before the host_id lookup.

    Closes-Bug: #1358668
    Change-Id: If30567d5deaeabd2de6c6287fac7a81695a41cc5

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/122987

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

Reviewed: https://review.openstack.org/122987
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=b464d893fe790514c0fa910b0b9fe72a47585379
Submitter: Jenkins
Branch: stable/icehouse

commit b464d893fe790514c0fa910b0b9fe72a47585379
Author: Kevin Benton <email address hidden>
Date: Mon Aug 18 21:49:31 2014 -0700

    Big Switch: Check for 'id' in port before lookup

    Check for the presence of the 'id' key before trying
    to do a lookup based on the value. This is necessary
    because a 'fields' param to get_port(s) may exclude
    the 'id' field before the host_id lookup.

    Conflicts:
     neutron/tests/unit/bigswitch/test_restproxy_plugin.py

    Closes-Bug: #1358668
    Change-Id: If30567d5deaeabd2de6c6287fac7a81695a41cc5
    (cherry picked from commit 295efa00081c770a57a5541652d9d3ffd5c1074d)

tags: added: in-stable-icehouse
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-rc1 → 2014.2
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.