![Boden R](/assets/img/avatar_default.png)
Today the get_extended_resources method of our APIExtensionDescriptor class does not account for the SUB_RESOURCE_ATTRIBUTE_MAP and as a result callers of update_attributes_map will also not see the sub resources. This patch updates get_extended_resources to include the sub resources as well. Note that today in neutron, we have both uses: - neutron.extensions.qos.Qos.get_extended_resources uses sub resources. - neutron.extensions.flavors.Flavors.get_extended_resources does not use the sub resource map. In addition this patch changes the methods defined in the APIExtensionDescriptor to be class methods rather than instance methods. There is no real instance data to maintain and in addition consumers need a way to access the update_attributes_map method without having to import and create a concrete neutron extension instance [1]. [1] http://codesearch.openstack.org/?q=%5C(%5C)%5C.update_attributes_map%5C( Change-Id: I8ae11633962a48de6e8559b85447b8c8c753d705
12 lines
539 B
YAML
12 lines
539 B
YAML
---
|
|
features:
|
|
- All methods defined in ``APIExtensionDescriptor`` are now class methods.
|
|
This allows consumers to call them without a reference to an actual
|
|
extension object instance.
|
|
fixes:
|
|
- The ``get_extended_resources`` method of the ``APIExtensionDescriptor``
|
|
was updated to also include the underlying API definition's
|
|
``SUB_RESOURCE_ATTRIBUTE_MAP`` in the returned dict. As a result, the
|
|
``update_attributes_map`` method now also includes the sub-resources if no
|
|
``extension_attrs_map`` is passed to it.
|