Incorrect usage of _fields method in provider_configuration.py

Bug #1227971 reported by Eugene Nikanorov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Eugene Nikanorov

Bug Description

When fields filtering is applied, neutron server prints a trace:

 ERROR neutron.api.v2.resource [-] index failed
 TRACE neutron.api.v2.resource Traceback (most recent call last):
 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 84, in resource
 TRACE neutron.api.v2.resource result = method(request=request, **args)
 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 273, in index
 TRACE neutron.api.v2.resource return self._items(request, True, parent_id)
 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 227, in _items
 TRACE neutron.api.v2.resource obj_list = obj_getter(request.context, **kwargs)
 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/servicetype_db.py", line 63, in get_service_providers
 TRACE neutron.api.v2.resource return self.conf.get_service_providers(filters, fields)
 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/services/provider_configuration.py", line 162, in get_service_providers
 TRACE neutron.api.v2.resource return self._fields(res, fields)
 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/services/provider_configuration.py", line 151, in _fields
 TRACE neutron.api.v2.resource return dict(((key, item) for key, item in resource.items()
 TRACE neutron.api.v2.resource AttributeError: 'list' object has no attribute 'items'

Tags: neutron-core
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/47519

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

Reviewed: https://review.openstack.org/47519
Committed: http://github.com/openstack/neutron/commit/396a0e42755af96d8b96d42ae1bcf4ae4604443d
Submitter: Jenkins
Branch: master

commit 396a0e42755af96d8b96d42ae1bcf4ae4604443d
Author: Eugene Nikanorov <email address hidden>
Date: Fri Sep 20 07:15:38 2013 +0400

    Fix usage of _fields method in provider_configuration.py

    Apply _fields() method to each dict in the list.

    Change-Id: I9357212e203843ffa4a05216d9c79fe8831971a5
    Closes-Bug: #1227971

Changed in neutron:
status: In Progress → Fix Committed
tags: added: neutron-core
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-rc1 → 2013.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.