]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Added check on plugin.supported_extension_aliases
authorAmir Sadoughi <amir.sadoughi@gmail.com>
Thu, 5 Sep 2013 06:38:41 +0000 (01:38 -0500)
committerAmir Sadoughi <amir.sadoughi@gmail.com>
Tue, 19 Nov 2013 18:51:21 +0000 (12:51 -0600)
commitf4c8a1831402cd4d48b2876e0b223f855020d896
tree2c1fc6df6048a2bdb30de8693b3ee9ed6387b84e
parentbc18247313f8153875e98b59ef876b896d9033d5
Added check on plugin.supported_extension_aliases

Added check to neutron.api.extensions.PluginAwareExtensionManager
which raises an exception when an alias in the plugin's
`supported_extension_aliases` list is not found in the set of loaded
extension aliases. If an alias is missing, it means the extension for
that alias has not been loaded, has not been found, and the file is
missing from paths listed in `oslo.config.CONF.api_extensions_path`.

This guards against a common class of bugs in plugins,
such as typographical errors in the `supported_extension_aliases`
property.

Plugin changes:

* bigswitch.plugin: Moves api_extensions_path override to plugin's
__init__ method, similar to other plugins.

* cisco.n1kv.n1kv_neutron_plugin: Removes "policy_profile_binding" and
"network_profile_binding" as they don't exist in Neutron currently.
Removed override of api_extensions_path as it is loaded through
cisco.network_plugin.

* cisco.network_plugin: Renames "Cisco Credential" to "credential".
Adds api_extension_path override to plugin's __init__ method.

* metaplugin.meta_neutron_plugin: Avoids alias of empty string when
cfg.CONF.META.supported_extension_aliases is an empty string.

* midonet.plugin: Fixes regression of 98e16a06 from 715b16ac.

* nec.nec_plugin: Extended override of api_extensions_path to append
nec extensions path to existing configured path.

* nicira.NeutronPlugin: Extended override of api_extensions_path to
append NXP_EXT_PATH to existing configured path.

Fixes: bug 1225080
Change-Id: Idcaade221d83c611fcbd87b503b2c8377d106962
14 files changed:
neutron/api/extensions.py
neutron/common/exceptions.py
neutron/plugins/bigswitch/plugin.py
neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py
neutron/plugins/cisco/network_plugin.py
neutron/plugins/metaplugin/meta_neutron_plugin.py
neutron/plugins/midonet/plugin.py
neutron/plugins/nec/extensions/packetfilter.py
neutron/plugins/nec/extensions/router_provider.py
neutron/plugins/nec/nec_plugin.py
neutron/plugins/nicira/NeutronPlugin.py
neutron/tests/unit/cisco/n1kv/test_n1kv_plugin.py
neutron/tests/unit/nicira/test_networkgw.py
neutron/tests/unit/test_extensions.py