← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1757513] [NEW] standardattrdescription clobbers existing description API attr

 

Public bug reported:

The commit [1] to use neutron-lib's segment API def surfaced an issue
[2] whereupon the standardattrdescription's update of the 'description'
attribute clobbers existing defs.

For example the segment API def has a 'description' [3] allowing it to be set to 'None'.
However the standardattrdescription overwrites that with its own description attribute [4] thereby causing [2]. This is the same reason for the hack in [5].

To me this behavior is odd in general; given an extension may already
define its own description attr.

A few fixes come to mind:
- The standardattrdescription ext can filter out those that already define the 'description' in their API def. This isn't much code.
- Extensions wanting to define a 'description' can remove themselves from the HasStandardAttributes (probably less than ideal) and just get it for free from standardattrdescription.

I could probably do the work here, just looking for a consensus on
direction.


[1] https://review.openstack.org/#/c/552140
[2] http://logs.openstack.org/74/553374/2/check/osc-functional-devstack/6321b58/job-output.txt.gz#_2018-03-21_14_43_24_047175
[3] https://github.com/openstack/neutron-lib/blob/master/neutron_lib/api/definitions/segment.py#L97
[4] https://github.com/openstack/neutron/blob/master/neutron/extensions/standardattrdescription.py#L22
[5] https://review.openstack.org/#/c/552140/4/neutron/tests/unit/extensions/test_segment.py@83

** Affects: neutron
     Importance: Undecided
         Status: New


** Tags: api

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

Title:
  standardattrdescription clobbers existing description API attr

Status in neutron:
  New

Bug description:
  The commit [1] to use neutron-lib's segment API def surfaced an issue
  [2] whereupon the standardattrdescription's update of the
  'description' attribute clobbers existing defs.

  For example the segment API def has a 'description' [3] allowing it to be set to 'None'.
  However the standardattrdescription overwrites that with its own description attribute [4] thereby causing [2]. This is the same reason for the hack in [5].

  To me this behavior is odd in general; given an extension may already
  define its own description attr.

  A few fixes come to mind:
  - The standardattrdescription ext can filter out those that already define the 'description' in their API def. This isn't much code.
  - Extensions wanting to define a 'description' can remove themselves from the HasStandardAttributes (probably less than ideal) and just get it for free from standardattrdescription.

  I could probably do the work here, just looking for a consensus on
  direction.


  [1] https://review.openstack.org/#/c/552140
  [2] http://logs.openstack.org/74/553374/2/check/osc-functional-devstack/6321b58/job-output.txt.gz#_2018-03-21_14_43_24_047175
  [3] https://github.com/openstack/neutron-lib/blob/master/neutron_lib/api/definitions/segment.py#L97
  [4] https://github.com/openstack/neutron/blob/master/neutron/extensions/standardattrdescription.py#L22
  [5] https://review.openstack.org/#/c/552140/4/neutron/tests/unit/extensions/test_segment.py@83

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


Follow ups