[openstack-dev] [neutron] extension implemented by multiple plugins

Bence Romsics bence.romsics at gmail.com
Mon Aug 17 14:35:58 UTC 2015


Hi All,

How do I implement one extension by two plugins?

If I extend the API by:
* a first class resource, and
* attributes to an already existing resource (the port resource in my case).

These two parts don't make sense without each other, so I'd like to
keep this as one extension, not two.

Then naturally I'd like to implement:
* the first class resource as a service plugin, and
* the new port attributes as an ml2 extension driver.

And straightforwardly I put the same extension alias into both the
service plugin and the ml2 extension driver. Then I get this error:

File "/opt/stack/neutron/neutron/manager.py", line 199, in _load_service_plugins
ValueError: Multiple plugins for service TRUNK_PORT were configured

IMHO prohibiting two plugins of the same type was good logic when we
had service plugins only, but now that we have ml2 extension drivers
too it seems to be buggy logic.

What do you think?
Shall we change this logic?
Maybe keep track of two sets of plugins, one for service plugins and
one for ml2 extension drivers?
Or do you know some other way?

For further details it seems to me the following files and methods are
implementing the current logic:

neutron/plugins/ml2/plugin.py:
Ml2Plugin.supported_extension_aliases()

neutron/plugins/ml2/managers.py:
ExtensionManager.extension_aliases()

neutron/manager.py:
NeutronManager._load_service_plugins()
NeutronManager._load_services_from_core_plugin()

Thanks in advance,
Bence



More information about the OpenStack-dev mailing list