3a75160742
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 of98e16a06
from715b16ac
. * 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
61 lines
1.7 KiB
Python
61 lines
1.7 KiB
Python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
|
#
|
|
# Copyright 2013 NEC Corporation. All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from neutron.api.v2 import attributes
|
|
from neutron.openstack.common import log as logging
|
|
|
|
|
|
LOG = logging.getLogger(__name__)
|
|
|
|
ROUTER_PROVIDER = 'provider'
|
|
|
|
ROUTER_PROVIDER_ATTRIBUTE = {
|
|
'routers': {ROUTER_PROVIDER:
|
|
{'allow_post': True,
|
|
'allow_put': False,
|
|
'is_visible': True,
|
|
'default': attributes.ATTR_NOT_SPECIFIED}
|
|
}
|
|
}
|
|
|
|
|
|
class Router_provider(object):
|
|
@classmethod
|
|
def get_name(cls):
|
|
return "Router Provider"
|
|
|
|
@classmethod
|
|
def get_alias(cls):
|
|
return "router_provider"
|
|
|
|
@classmethod
|
|
def get_description(cls):
|
|
return "Router Provider Support"
|
|
|
|
@classmethod
|
|
def get_namespace(cls):
|
|
return "http://docs.openstack.org/ext/router_provider/api/v1.0"
|
|
|
|
@classmethod
|
|
def get_updated(cls):
|
|
return "2013-08-20T10:00:00-00:00"
|
|
|
|
def get_extended_resources(self, version):
|
|
if version == "2.0":
|
|
return ROUTER_PROVIDER_ATTRIBUTE
|
|
else:
|
|
return {}
|