get_subnetpool() raise error when called with unset filters

Bug #1647715 reported by Artur Korzeniewski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Artur Korzeniewski

Bug Description

get_subnetpools() from db_base_plugin_v2 is raising error when called with unset filters argument.
This is because filters are by default set to None and when calling OVO, the filters are passed as kwargs using '**':
https://github.com/openstack/neutron/blob/10.0.0.0b1/neutron/db/db_base_plugin_v2.py#L1087

It is only issue when calling directly using plugin.
Unit tests were not covering it.

API is tested and okay.

This is also affecting Newton.

Changed in neutron:
assignee: nobody → Artur Korzeniewski (artur-korzeniewski)
Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/407058
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3ee76d4980b81354ff19da24de1a0c6e4b67903c
Submitter: Jenkins
Branch: master

commit 3ee76d4980b81354ff19da24de1a0c6e4b67903c
Author: Artur Korzeniewski <email address hidden>
Date: Tue Dec 6 14:28:38 2016 +0100

    Convert filters to empty dict if None in DB's get_subnetpools().

    When calling ML2 plugin's get_subnetpools(), 'fields' parameters may be
    passed. By default it is set to None. The 'filters' is passed to
    SubnetPool.get_objects() as kwargs (using **). If someone calls plugin's
    get_subnetpools() without passing filters, the method will raise exception.

    This patch is adding support for 'filters' being None when calling
    plugin get_subnetpools(), by converting it to be empty dict '{}'.

    Change-Id: Ic7432cb167583e82b3c0e237ef25a5c9f21986e6
    Closes-Bug: 1647715

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

This issue was fixed in the openstack/neutron 10.0.0.0b2 development milestone.

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.