← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1722842] Re: [RFE] API extension framework: impossible to extend a sub-resource

 

Reviewed:  https://review.openstack.org/511280
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=605364ad78407e3176dd79d0e4fe84cf87c8ce8e
Submitter: Zuul
Branch:    master

commit 605364ad78407e3176dd79d0e4fe84cf87c8ce8e
Author: Thomas Morin <thomas.morin@xxxxxxxxxx>
Date:   Wed Oct 11 17:57:49 2017 +0200

    Support that an extension extends a sub-resource
    
    The neutron.api.extensions code assumes that the resource to update are
    base resources and updates its dictionary. When the resource
    is a sub-resource, ie. a {'parent': ... , 'parameters': {..} } dictionary,
    the result of the update is that the content of 'parameters' is
    overwritten.
    
    The correct thing to do here, in the case where the extended resource is
    a sub-resource, is to update the content of parameters with the new/changed
    attributes.
    
    This change also removes a workaround that was made in
    the qos-bw-limit-direction extension, and which after the change in API
    extension code, is not needed anymore.
    
    Needed-By: I263e1ee6cf4e1a91be91a4a78f4a160f64d33cc6
    Change-Id: I4cb61481205c3689c41e62670cec113adb2a0362
    Closes-Bug: 1722842


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1722842

Title:
  [RFE] API extension framework: impossible to extend a sub-resource

Status in neutron:
  Fix Released

Bug description:
  The code at [1] assumes that the resource to update is a base resource
  and the code update its dictionary.  When the resource is a sub-
  resource, ie. a {'parent': ... , 'parameters': {..} } dictionary, the
  result of the update() call is that the content of 'parameters' is
  overwritten, while the correct thing to here would be to update the
  content of parameters with the new/changed attributes introduced by
  the extension.

  (This issue is blocking the implementation of the bgpvpn routes-
  control blueprint [2] which is about an API extension that adds
  attributes to the "router_association" sub-resource introduced by the
  bgpvpn API extension.)

  [1] https://github.com/openstack/neutron/blob/master/neutron/api/extensions.py#L348
  [2] https://blueprints.launchpad.net/bgpvpn/+spec/routes-control

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1722842/+subscriptions


References