Fails in get_networks if filter unset

Bug #1060047 reported by Julien Danjou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Julien Danjou

Bug Description

Considering the following:

    context = context.get_admin_context()
    plugin = manager.QuantumManager.get_plugin()
    plugin.get_networks(context):

fails with:

Traceback (most recent call last):
  File "/tmp/quantum-usage-audit", line 64, in <module>
    for network in plugin.get_networks(context):
  File "/opt/stack/quantum/quantum/plugins/openvswitch/ovs_quantum_plugin.py", line 477, in get_networks
    nets = self._filter_nets_l3(context, nets, filters)
  File "/opt/stack/quantum/quantum/db/l3_db.py", line 712, in _filter_nets_l3
    vals = filters.get('router:external', [])
AttributeError: 'NoneType' object has no attribute 'get'

This is because _filter_nets_l3 does not check filters to be None.

Changed in quantum:
assignee: nobody → Julien Danjou (jdanjou)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/13903
Committed: http://github.com/openstack/quantum/commit/f723e1a359ff8079356b05a945c7b82252f2cb42
Submitter: Jenkins
Branch: master

commit f723e1a359ff8079356b05a945c7b82252f2cb42
Author: Julien Danjou <email address hidden>
Date: Tue Oct 2 15:37:49 2012 +0200

    Fix filters default value in get_networks

    With that change, if get_networks() is called without fields set to
    something, _filter_nets_l3 fails because it tries to call "filters.get()"
    where filters is None.

    This fixes bug #1060047

    Change-Id: Ia0787e7a278a3562af5409861762f067d71f2cf6
    Signed-off-by: Julien Danjou <email address hidden>

Changed in quantum:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in quantum:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in quantum:
milestone: grizzly-1 → 2013.1
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.