golang api fails to update network-ipam refs

Bug #1541654 reported by Pedro Marques
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Undecided
Pedro Marques
OpenContrail
In Progress
Undecided
Pedro Marques

Bug Description

The generated golang API classes have a problem when dealing with updates.

The contrail-api supports updating a reference field as a write with the full content (via the PUT method of the object) or as a ADD/DELETE operation via the update-refs URI.

The desired outcome is to use the PUT method when:
  1. The new set of refs is empty.
  2. The old set of refs is empty.
  3. The old set of refs is unknown (since the Clear operation doesn't perform a read of the refs).

Otherwise, when the previous list of refs is known, the code should use the "update-refs" URI.

The current code incorrectly assumes that the current set of refs is the empty set when a Clear operation is issued and the
refs field is no marked as valid.

Tags: golang-api
Pedro Marques (5-roque)
Changed in opencontrail:
assignee: nobody → Pedro Marques (5-roque)
status: New → In Progress
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/16849
Submitter: Pedro Marques (<email address hidden>)

Pedro Marques (5-roque)
tags: added: golang-api
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/16849
Committed: http://github.org/Juniper/contrail-generateDS/commit/217bbb0ef47ae81e85e1de75bf8b3d7e3338f7c7
Submitter: Zuul
Branch: master

commit 217bbb0ef47ae81e85e1de75bf8b3d7e3338f7c7
Author: Pedro Roque Marques <email address hidden>
Date: Wed Feb 3 16:36:57 2016 -0800

Fix the logic regarding reference updates.

References can be updated via the PUT operation on the object
or via the update-ref URI. Ensure that they are only done via
one of these mechanisms (not both on the same update).

Reference clear operations do not perform a read. Do not store
the current value of the reference list when it is unknown.

Fix the copying of the data used to compare references.

Change-Id: Ie24588d315f0c70f48040258c1b270b0b84a85d5
Closes-bug: #1541654

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.