Small issue with update operation in base.py

Bug #1194520 reported by Salvatore Orlando
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Salvatore Orlando

Bug Description

This expression:

https://github.com/openstack/quantum/blob/master/quantum/api/v2/base.py#L462

Will build a field list with more fields than required. For instance, the 'status' field will always be broguht in.
This is a super-minor possibly irrelevant issue, but some plugins (well at least one) take a different path involving API calls to 3rd party backend when the 'status' field is passed in.

The fix is straightforward:
diff --git a/quantum/api/v2/base.py b/quantum/api/v2/base.py
index c8bbf42..df3d31b 100644
--- a/quantum/api/v2/base.py
+++ b/quantum/api/v2/base.py
@@ -461,8 +461,8 @@ class Controller(object):
         # by the policy engine to the policy 'brain'
         field_list = [name for (name, value) in self._attr_info.iteritems()
                       if ('required_by_policy' in value and
- value['required_by_policy'] or
- 'default' not in value)]
+ (value['required_by_policy'] or
+ 'default' not in value))]
         orig_obj = self._item(request, id, field_list=field_list,
                               parent_id=parent_id)
         orig_obj.update(body[self._resource])

Tags: api
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

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

Changed in quantum:
status: Confirmed → In Progress
Changed in neutron:
milestone: havana-2 → havana-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/34412
Committed: http://github.com/openstack/neutron/commit/4e9b8bc3c60cd22ca4c96baa70ab72f9206fe4d5
Submitter: Jenkins
Branch: master

commit 4e9b8bc3c60cd22ca4c96baa70ab72f9206fe4d5
Author: Salvatore Orlando <email address hidden>
Date: Tue Jun 25 16:36:20 2013 +0200

    Fix logic for building field_list in update

    Bug 1194520

    Change-Id: Ie3ea7b77dc9a4f712e3e838c20c062db1b2d9faa

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-3 → 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.