normalize and use ALIAS in supported_extension_aliases
This patch: - Addresses a few missed by https://review.openstack.org/#/c/637962/ - Updates all the vmware_nsx.extensions.* to use ALIAS for their API extension alias variable rather than use a random or no constant name for the alias. Change-Id: Ice88f1d6a451fb0d82587a9fb6b1a6a7f285c8c6
This commit is contained in:
parent
c2b779d278
commit
11c6b535a1
@ -128,7 +128,7 @@ class DhcpMetadataAccess(object):
|
||||
LOG.warning('network_auto_schedule has been disabled')
|
||||
notifier = combined.DhcpAgentNotifyAPI(weakref.proxy(self),
|
||||
lsn_manager)
|
||||
self.supported_extension_aliases.append(lsn.EXT_ALIAS)
|
||||
self.supported_extension_aliases.append(lsn.ALIAS)
|
||||
# Add the capability to migrate dhcp and metadata services over
|
||||
self.migration_manager = (
|
||||
migration.MigrationManager(
|
||||
@ -136,7 +136,7 @@ class DhcpMetadataAccess(object):
|
||||
return notifier
|
||||
|
||||
def _init_extensions(self):
|
||||
extensions = (lsn.EXT_ALIAS, agent_apidef.ALIAS,
|
||||
extensions = (lsn.ALIAS, agent_apidef.ALIAS,
|
||||
dhcpagentscheduler.ALIAS)
|
||||
for ext in extensions:
|
||||
if ext in self.supported_extension_aliases:
|
||||
|
@ -44,7 +44,7 @@ def _dotted_domain(dns_domain):
|
||||
|
||||
# TODO(asarfaty) use dns-domain/nameserver from network az instead of global
|
||||
class DNSExtensionDriver(driver_api.ExtensionDriver):
|
||||
_supported_extension_alias = 'dns-integration'
|
||||
_supported_extension_alias = dns.ALIAS
|
||||
|
||||
@property
|
||||
def extension_alias(self):
|
||||
|
@ -16,7 +16,7 @@ from neutron_lib.api import extensions
|
||||
|
||||
# Attribute Map
|
||||
ADV_SERVICE_PROVIDERS = 'advanced_service_providers'
|
||||
|
||||
ALIAS = 'advanced-service-providers'
|
||||
|
||||
EXTENDED_ATTRIBUTES_2_0 = {
|
||||
'subnets': {
|
||||
@ -34,7 +34,7 @@ class Advancedserviceproviders(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "advanced-service-providers"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -18,6 +18,9 @@
|
||||
from neutron_lib.api import extensions
|
||||
from neutron_lib.db import constants as db_const
|
||||
|
||||
|
||||
ALIAS = 'api-replay'
|
||||
|
||||
# The attributes map is here for 2 reasons:
|
||||
# 1) allow posting id for the different objects we are importing
|
||||
# 2) make sure security-group named 'default' is also copied
|
||||
@ -61,7 +64,7 @@ class Api_replay(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return 'api-replay'
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -16,6 +16,7 @@ from neutron_lib.api import extensions
|
||||
from neutron_lib import constants
|
||||
|
||||
DHCP_MTU = 'dhcp_mtu'
|
||||
ALIAS = 'dhcp-mtu'
|
||||
EXTENDED_ATTRIBUTES_2_0 = {
|
||||
'subnets': {
|
||||
DHCP_MTU: {
|
||||
@ -37,7 +38,7 @@ class Dhcp_mtu(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "dhcp-mtu"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -66,6 +66,7 @@ def _validate_dns_search_domain(data, max_len=db_const.NAME_FIELD_SIZE):
|
||||
validators.add_validator('dns_search_domain', _validate_dns_search_domain)
|
||||
|
||||
|
||||
ALIAS = 'dns-search-domain'
|
||||
DNS_SEARCH_DOMAIN = 'dns_search_domain'
|
||||
EXTENDED_ATTRIBUTES_2_0 = {
|
||||
'subnets': {
|
||||
@ -87,7 +88,7 @@ class Dns_search_domain(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "dns-search-domain"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -22,7 +22,7 @@ from vmware_nsx._i18n import _
|
||||
|
||||
EDGE_SERVICE_GW = 'esg_id'
|
||||
EDGE_ID_MAX_LEN = 15
|
||||
ESG_BGP_PEER_EXT_ALIAS = 'edge-service-gateway-bgp-peer'
|
||||
ALIAS = 'edge-service-gateway-bgp-peer'
|
||||
|
||||
|
||||
def _validate_edge_service_gw_id(esg_id, valid_values=None):
|
||||
@ -87,7 +87,7 @@ class Edge_service_gateway_bgp_peer(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return ESG_BGP_PEER_EXT_ALIAS
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -24,6 +24,7 @@ from vmware_nsx._i18n import _
|
||||
|
||||
HOUSEKEEPER_RESOURCE_NAME = "housekeeper"
|
||||
HOUSEKEEPERS = "housekeepers"
|
||||
ALIAS = 'housekeeper'
|
||||
|
||||
# The housekeeper tasks table is read only
|
||||
RESOURCE_ATTRIBUTE_MAP = {
|
||||
@ -53,7 +54,7 @@ class Housekeeper(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return HOUSEKEEPER_RESOURCE_NAME
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -21,8 +21,8 @@ from neutron_lib.api import extensions as api_extensions
|
||||
from neutron_lib.plugins import directory
|
||||
|
||||
|
||||
EXT_ALIAS = 'lsn'
|
||||
COLLECTION_NAME = "%ss" % EXT_ALIAS
|
||||
ALIAS = 'lsn'
|
||||
COLLECTION_NAME = "%ss" % ALIAS
|
||||
|
||||
RESOURCE_ATTRIBUTE_MAP = {
|
||||
COLLECTION_NAME: {
|
||||
@ -47,7 +47,7 @@ class Lsn(api_extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return EXT_ALIAS
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
@ -62,7 +62,7 @@ class Lsn(api_extensions.ExtensionDescriptor):
|
||||
"""Returns Ext Resources."""
|
||||
exts = []
|
||||
plugin = directory.get_plugin()
|
||||
resource_name = EXT_ALIAS
|
||||
resource_name = ALIAS
|
||||
collection_name = resource_name.replace('_', '-') + "s"
|
||||
params = RESOURCE_ATTRIBUTE_MAP.get(COLLECTION_NAME, dict())
|
||||
controller = base.create_resource(collection_name,
|
||||
|
@ -17,6 +17,7 @@ from neutron_lib.api import extensions
|
||||
from neutron_lib import constants
|
||||
|
||||
|
||||
ALIAS = 'mac-learning'
|
||||
MAC_LEARNING = 'mac_learning_enabled'
|
||||
EXTENDED_ATTRIBUTES_2_0 = {
|
||||
'ports': {
|
||||
@ -37,7 +38,7 @@ class Maclearning(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "mac-learning"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -29,8 +29,8 @@ from vmware_nsx._i18n import _
|
||||
GATEWAY_RESOURCE_NAME = "network_gateway"
|
||||
DEVICE_RESOURCE_NAME = "gateway_device"
|
||||
# Use dash for alias and collection name
|
||||
EXT_ALIAS = GATEWAY_RESOURCE_NAME.replace('_', '-')
|
||||
NETWORK_GATEWAYS = "%ss" % EXT_ALIAS
|
||||
ALIAS = GATEWAY_RESOURCE_NAME.replace('_', '-')
|
||||
NETWORK_GATEWAYS = "%ss" % ALIAS
|
||||
GATEWAY_DEVICES = "%ss" % DEVICE_RESOURCE_NAME.replace('_', '-')
|
||||
DEVICE_ID_ATTR = 'id'
|
||||
IFACE_NAME_ATTR = 'interface_name'
|
||||
@ -173,7 +173,7 @@ class Networkgw(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return EXT_ALIAS
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -23,7 +23,7 @@ from vmware_nsx._i18n import _
|
||||
|
||||
POLICY_RESOURCE_NAME = "nsx_policy"
|
||||
# Use dash for alias and collection name
|
||||
EXT_ALIAS = POLICY_RESOURCE_NAME.replace('_', '-')
|
||||
ALIAS = POLICY_RESOURCE_NAME.replace('_', '-')
|
||||
NSX_POLICIES = "nsx_policies"
|
||||
|
||||
# The nsx-policies table is read only
|
||||
@ -48,7 +48,7 @@ class Nsxpolicy(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return EXT_ALIAS
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -24,7 +24,7 @@ from vmware_nsx._i18n import _
|
||||
|
||||
PROJECT_PLUGIN_RESOURCE_NAME = "project_plugin_map"
|
||||
# Use dash for alias and collection name
|
||||
EXT_ALIAS = PROJECT_PLUGIN_RESOURCE_NAME.replace('_', '-')
|
||||
ALIAS = PROJECT_PLUGIN_RESOURCE_NAME.replace('_', '-')
|
||||
PROJECT_PLUGINS = "project_plugin_maps"
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ class Projectpluginmap(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return EXT_ALIAS
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -20,6 +20,7 @@ from neutron_lib import exceptions as nexception
|
||||
from vmware_nsx._i18n import _
|
||||
|
||||
|
||||
ALIAS = 'provider-security-group'
|
||||
PROVIDER = 'provider'
|
||||
PROVIDER_SECURITYGROUPS = 'provider_security_groups'
|
||||
|
||||
@ -75,7 +76,7 @@ class Providersecuritygroup(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "provider-security-group"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -27,6 +27,7 @@ from neutron_lib.plugins import directory
|
||||
|
||||
from vmware_nsx._i18n import _
|
||||
|
||||
ALIAS = 'qos-queue'
|
||||
# For policy.json/Auth
|
||||
qos_queue_create = "create_qos_queue"
|
||||
qos_queue_delete = "delete_qos_queue"
|
||||
@ -176,7 +177,7 @@ class Qos_queue(api_extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "qos-queue"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -16,6 +16,7 @@ from neutron_lib.api import extensions
|
||||
from neutron_lib import constants
|
||||
|
||||
|
||||
ALIAS = 'nsxv-router-size'
|
||||
ROUTER_SIZE = 'router_size'
|
||||
VALID_EDGE_SIZES = ['compact', 'large', 'xlarge', 'quadlarge']
|
||||
EXTENDED_ATTRIBUTES_2_0 = {
|
||||
@ -37,7 +38,7 @@ class Routersize(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "nsxv-router-size"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -16,6 +16,7 @@ from neutron_lib.api import extensions
|
||||
from neutron_lib import constants
|
||||
|
||||
|
||||
ALIAS = 'nsxv-router-type'
|
||||
ROUTER_TYPE = 'router_type'
|
||||
VALID_TYPES = ['shared', 'exclusive']
|
||||
EXTENDED_ATTRIBUTES_2_0 = {
|
||||
@ -37,7 +38,7 @@ class Routertype(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "nsxv-router-type"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -17,6 +17,8 @@ from neutron.extensions import securitygroup
|
||||
from neutron_lib.api import extensions
|
||||
from neutron_lib import constants
|
||||
|
||||
|
||||
ALIAS = 'secgroup-rule-local-ip-prefix'
|
||||
LOCAL_IP_PREFIX = 'local_ip_prefix'
|
||||
|
||||
RESOURCE_ATTRIBUTE_MAP = {
|
||||
@ -43,7 +45,7 @@ class Secgroup_rule_local_ip_prefix(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "secgroup-rule-local-ip-prefix"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -15,6 +15,7 @@
|
||||
from neutron_lib.api import converters
|
||||
from neutron_lib.api import extensions
|
||||
|
||||
ALIAS = 'security-group-logging'
|
||||
LOGGING = 'logging'
|
||||
|
||||
RESOURCE_ATTRIBUTE_MAP = {
|
||||
@ -39,7 +40,7 @@ class Securitygrouplogging(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "security-group-logging"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -17,6 +17,8 @@ from neutron_lib import exceptions as nexception
|
||||
|
||||
from vmware_nsx._i18n import _
|
||||
|
||||
|
||||
ALIAS = 'security-group-policy'
|
||||
POLICY = 'policy'
|
||||
|
||||
RESOURCE_ATTRIBUTE_MAP = {
|
||||
@ -45,7 +47,7 @@ class Securitygrouppolicy(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "security-group-policy"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -17,7 +17,7 @@ from neutron_lib.api import extensions
|
||||
|
||||
# Attribute Map
|
||||
VNIC_INDEX = 'vnic_index'
|
||||
|
||||
ALIAS = 'vnic-index'
|
||||
|
||||
EXTENDED_ATTRIBUTES_2_0 = {
|
||||
'ports': {
|
||||
@ -36,7 +36,7 @@ class Vnicindex(extensions.ExtensionDescriptor):
|
||||
|
||||
@classmethod
|
||||
def get_alias(cls):
|
||||
return "vnic-index"
|
||||
return ALIAS
|
||||
|
||||
@classmethod
|
||||
def get_description(cls):
|
||||
|
@ -89,7 +89,7 @@ class NsxTVDPlugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
||||
nsx_com_az.NSXAvailabilityZonesPluginCommon,
|
||||
projectpluginmap.ProjectPluginMapPluginBase):
|
||||
|
||||
supported_extension_aliases = ['project-plugin-map']
|
||||
supported_extension_aliases = [projectpluginmap.ALIAS]
|
||||
|
||||
__native_bulk_support = True
|
||||
__native_pagination_support = True
|
||||
@ -173,7 +173,7 @@ class NsxTVDPlugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
||||
raise nsx_exc.NsxPluginException(err_msg=msg)
|
||||
|
||||
for k, val in self.plugins.items():
|
||||
if "advanced-service-providers" in val.supported_extension_aliases:
|
||||
if as_providers.ALIAS in val.supported_extension_aliases:
|
||||
self.as_providers[k] = val
|
||||
LOG.info("NSX-TVD plugin will use %s as the default plugin",
|
||||
self.default_plugin)
|
||||
|
@ -128,12 +128,12 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||
dvr_apidef.ALIAS,
|
||||
"ext-gw-mode",
|
||||
xroute_apidef.ALIAS,
|
||||
"mac-learning",
|
||||
"multi-provider",
|
||||
"network-gateway",
|
||||
mac_ext.ALIAS,
|
||||
mpnet_apidef.ALIAS,
|
||||
networkgw.ALIAS,
|
||||
psec.ALIAS,
|
||||
pnet.ALIAS,
|
||||
"qos-queue",
|
||||
qos.ALIAS,
|
||||
"quotas",
|
||||
extnet_apidef.ALIAS,
|
||||
edo_ext.ALIAS,
|
||||
|
@ -30,6 +30,7 @@ from neutron.db import models_v2
|
||||
from neutron.extensions import providernet
|
||||
from neutron.extensions import securitygroup as ext_sg
|
||||
from neutron.quota import resource_registry
|
||||
from neutron_lib.api.definitions import address_scope
|
||||
from neutron_lib.api.definitions import agent as agent_apidef
|
||||
from neutron_lib.api.definitions import allowedaddresspairs as addr_apidef
|
||||
from neutron_lib.api.definitions import availability_zone as az_apidef
|
||||
@ -121,7 +122,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
||||
__native_sorting_support = True
|
||||
|
||||
supported_extension_aliases = [addr_apidef.ALIAS,
|
||||
"address-scope",
|
||||
address_scope.ALIAS,
|
||||
"quotas",
|
||||
pbin_apidef.ALIAS,
|
||||
ext_edo.ALIAS,
|
||||
@ -129,7 +130,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
||||
dhcpagentscheduler.ALIAS,
|
||||
"ext-gw-mode",
|
||||
"security-group",
|
||||
"secgroup-rule-local-ip-prefix",
|
||||
sg_prefix.ALIAS,
|
||||
psec.ALIAS,
|
||||
pnet_apidef.ALIAS,
|
||||
external_net.ALIAS,
|
||||
@ -139,10 +140,10 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
||||
network_availability_zone.ALIAS,
|
||||
router_availability_zone.ALIAS,
|
||||
"subnet_allocation",
|
||||
"security-group-logging",
|
||||
"provider-security-group",
|
||||
sg_logging.ALIAS,
|
||||
provider_sg.ALIAS,
|
||||
"port-security-groups-filtering",
|
||||
'mac-learning']
|
||||
mac_ext.ALIAS]
|
||||
|
||||
@resource_registry.tracked_resources(
|
||||
network=models_v2.Network,
|
||||
|
@ -19,6 +19,7 @@ import xml.etree.ElementTree as et
|
||||
import netaddr
|
||||
|
||||
from neutron_lib.agent import topics
|
||||
from neutron_lib.api.definitions import address_scope
|
||||
from neutron_lib.api.definitions import agent as agent_apidef
|
||||
from neutron_lib.api.definitions import allowedaddresspairs as addr_apidef
|
||||
from neutron_lib.api.definitions import availability_zone as az_def
|
||||
@ -133,6 +134,7 @@ from vmware_nsx.extensions import nsxpolicy
|
||||
from vmware_nsx.extensions import projectpluginmap
|
||||
from vmware_nsx.extensions import providersecuritygroup as provider_sg
|
||||
from vmware_nsx.extensions import routersize
|
||||
from vmware_nsx.extensions import routertype
|
||||
from vmware_nsx.extensions import secgroup_rule_local_ip_prefix
|
||||
from vmware_nsx.extensions import securitygrouplogging as sg_logging
|
||||
from vmware_nsx.extensions import securitygrouppolicy as sg_policy
|
||||
@ -215,9 +217,9 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||
|
||||
supported_extension_aliases = [agent_apidef.ALIAS,
|
||||
addr_apidef.ALIAS,
|
||||
"address-scope",
|
||||
address_scope.ALIAS,
|
||||
pbin.ALIAS,
|
||||
"dns-search-domain",
|
||||
ext_dns_search_domain.ALIAS,
|
||||
dvr_apidef.ALIAS,
|
||||
"ext-gw-mode",
|
||||
mpnet_apidef.ALIAS,
|
||||
@ -229,21 +231,21 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||
extraroute.ALIAS,
|
||||
l3_apidef.ALIAS,
|
||||
"security-group",
|
||||
"secgroup-rule-local-ip-prefix",
|
||||
"security-group-logging",
|
||||
"nsxv-router-type",
|
||||
"nsxv-router-size",
|
||||
"vnic-index",
|
||||
"advanced-service-providers",
|
||||
secgroup_rule_local_ip_prefix.ALIAS,
|
||||
sg_logging.ALIAS,
|
||||
routertype.ALIAS,
|
||||
routersize.ALIAS,
|
||||
ext_vnic_idx.ALIAS,
|
||||
as_providers.ALIAS,
|
||||
"subnet_allocation",
|
||||
az_def.ALIAS,
|
||||
network_availability_zone.ALIAS,
|
||||
router_availability_zone.ALIAS,
|
||||
l3_flavors.ALIAS,
|
||||
flavors_apidef.ALIAS,
|
||||
"dhcp-mtu",
|
||||
"mac-learning",
|
||||
"housekeeper",
|
||||
ext_dhcp_mtu.ALIAS,
|
||||
mac_ext.ALIAS,
|
||||
hk_ext.ALIAS,
|
||||
"port-security-groups-filtering"]
|
||||
|
||||
__native_bulk_support = True
|
||||
@ -318,8 +320,8 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||
# Support NSX policies in default security groups
|
||||
self._use_nsx_policies = True
|
||||
# enable the extension
|
||||
self.supported_extension_aliases.append("security-group-policy")
|
||||
self.supported_extension_aliases.append("nsx-policy")
|
||||
self.supported_extension_aliases.append(sg_policy.ALIAS)
|
||||
self.supported_extension_aliases.append(nsxpolicy.ALIAS)
|
||||
|
||||
# Support transparent VLANS from 6.3.0 onwards. The feature is only
|
||||
# supported if the global configuration flag vlan_transparent is
|
||||
@ -352,7 +354,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
||||
resources.SUBNETPOOL_ADDRESS_SCOPE, events.AFTER_UPDATE)
|
||||
|
||||
if c_utils.is_nsxv_version_6_2(self.nsx_v.vcns.get_version()):
|
||||
self.supported_extension_aliases.append("provider-security-group")
|
||||
self.supported_extension_aliases.append(provider_sg.ALIAS)
|
||||
|
||||
# Bind QoS notifications
|
||||
qos_driver.register(self)
|
||||
|
@ -18,6 +18,7 @@ import time
|
||||
import mock
|
||||
import netaddr
|
||||
from neutron_lib.agent import topics
|
||||
from neutron_lib.api.definitions import address_scope
|
||||
from neutron_lib.api.definitions import agent as agent_apidef
|
||||
from neutron_lib.api.definitions import allowedaddresspairs as addr_apidef
|
||||
from neutron_lib.api.definitions import availability_zone
|
||||
@ -80,10 +81,12 @@ from vmware_nsx.common import nsx_constants
|
||||
from vmware_nsx.common import utils
|
||||
from vmware_nsx.db import db as nsx_db
|
||||
from vmware_nsx.dhcp_meta import rpc as nsx_rpc
|
||||
from vmware_nsx.extensions import api_replay
|
||||
from vmware_nsx.extensions import housekeeper as hk_ext
|
||||
from vmware_nsx.extensions import maclearning as mac_ext
|
||||
from vmware_nsx.extensions import projectpluginmap
|
||||
from vmware_nsx.extensions import providersecuritygroup as provider_sg
|
||||
from vmware_nsx.extensions import secgroup_rule_local_ip_prefix
|
||||
from vmware_nsx.extensions import securitygrouplogging as sg_logging
|
||||
from vmware_nsx.plugins.common.housekeeper import housekeeper
|
||||
from vmware_nsx.plugins.common_v3 import plugin as nsx_plugin_common
|
||||
@ -139,7 +142,7 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base,
|
||||
__native_sorting_support = True
|
||||
|
||||
supported_extension_aliases = [addr_apidef.ALIAS,
|
||||
"address-scope",
|
||||
address_scope.ALIAS,
|
||||
"quotas",
|
||||
pbin_apidef.ALIAS,
|
||||
ext_edo.ALIAS,
|
||||
@ -147,7 +150,7 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base,
|
||||
dhcpagentscheduler.ALIAS,
|
||||
"ext-gw-mode",
|
||||
"security-group",
|
||||
"secgroup-rule-local-ip-prefix",
|
||||
secgroup_rule_local_ip_prefix.ALIAS,
|
||||
psec.ALIAS,
|
||||
provider_net.ALIAS,
|
||||
extnet_apidef.ALIAS,
|
||||
@ -157,9 +160,9 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base,
|
||||
network_availability_zone.ALIAS,
|
||||
router_availability_zone.ALIAS,
|
||||
"subnet_allocation",
|
||||
"security-group-logging",
|
||||
"provider-security-group",
|
||||
"housekeeper",
|
||||
sg_logging.ALIAS,
|
||||
provider_sg.ALIAS,
|
||||
hk_ext.ALIAS,
|
||||
"port-security-groups-filtering"]
|
||||
|
||||
@resource_registry.tracked_resources(
|
||||
@ -242,7 +245,7 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base,
|
||||
|
||||
self._unsubscribe_callback_events()
|
||||
if cfg.CONF.api_replay_mode:
|
||||
self.supported_extension_aliases.append('api-replay')
|
||||
self.supported_extension_aliases.append(api_replay.ALIAS)
|
||||
|
||||
# Support transparent VLANS from 2.2.0 onwards. The feature is only
|
||||
# supported if the global configuration flag vlan_transparent is
|
||||
@ -512,7 +515,7 @@ class NsxV3Plugin(nsx_plugin_common.NsxPluginV3Base,
|
||||
try:
|
||||
self._init_mac_learning_profile()
|
||||
# Only expose the extension if it is supported
|
||||
self.supported_extension_aliases.append('mac-learning')
|
||||
self.supported_extension_aliases.append(mac_ext.ALIAS)
|
||||
except Exception as e:
|
||||
LOG.warning("Unable to initialize NSX v3 MAC Learning "
|
||||
"profile: %(name)s. Reason: %(reason)s",
|
||||
|
@ -43,7 +43,7 @@ class NSXBgpPlugin(service_base.ServicePluginBase, bgp_db.BgpDbMixin):
|
||||
"""
|
||||
|
||||
supported_extension_aliases = [bgp_ext.BGP_EXT_ALIAS,
|
||||
ext_esg.ESG_BGP_PEER_EXT_ALIAS]
|
||||
ext_esg.ALIAS]
|
||||
|
||||
def __init__(self):
|
||||
super(NSXBgpPlugin, self).__init__()
|
||||
|
@ -83,7 +83,7 @@ class NetworkGatewayExtensionTestCase(base.BaseTestCase):
|
||||
|
||||
# Instantiate mock plugin and enable extensions
|
||||
self.plugin.return_value.supported_extension_aliases = (
|
||||
[networkgw.EXT_ALIAS])
|
||||
[networkgw.ALIAS])
|
||||
directory.add_plugin(constants.CORE, self.plugin.return_value)
|
||||
ext_mgr = TestExtensionManager()
|
||||
extensions.PluginAwareExtensionManager._instance = ext_mgr
|
||||
@ -1096,7 +1096,7 @@ class TestNetworkGatewayPlugin(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
networkgw_db.NetworkGatewayMixin):
|
||||
"""Simple plugin class for testing db support for network gateway ext."""
|
||||
|
||||
supported_extension_aliases = ["network-gateway"]
|
||||
supported_extension_aliases = [networkgw.ALIAS]
|
||||
|
||||
def __init__(self, **args):
|
||||
super(TestNetworkGatewayPlugin, self).__init__(**args)
|
||||
|
@ -42,7 +42,7 @@ class ProviderSecurityGroupTestPlugin(
|
||||
securitygroups_db.SecurityGroupDbMixin):
|
||||
|
||||
supported_extension_aliases = ["security-group",
|
||||
"provider-security-group"]
|
||||
provider_sg.ALIAS]
|
||||
|
||||
def create_security_group(self, context, security_group, default_sg=False):
|
||||
secgroup = security_group['security_group']
|
||||
|
@ -45,7 +45,7 @@ class ExtendedRuleTestPlugin(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
securitygroups_db.SecurityGroupDbMixin):
|
||||
|
||||
supported_extension_aliases = ["security-group",
|
||||
"secgroup-rule-local-ip-prefix"]
|
||||
ext_loip.ALIAS]
|
||||
|
||||
def create_security_group_rule(self, context, security_group_rule):
|
||||
rule = security_group_rule['security_group_rule']
|
||||
|
@ -38,7 +38,7 @@ _uuid = uuidutils.generate_uuid
|
||||
class VnicIndexTestPlugin(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
vnic_index_db.VnicIndexDbMixin):
|
||||
|
||||
supported_extension_aliases = ["vnic-index"]
|
||||
supported_extension_aliases = [vnicidx.ALIAS]
|
||||
|
||||
def update_port(self, context, id, port):
|
||||
p = port['port']
|
||||
|
@ -13,6 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from vmware_nsx.extensions import api_replay
|
||||
from vmware_nsx.tests.unit.nsx_v3 import test_plugin
|
||||
|
||||
from neutron_lib.api import attributes
|
||||
@ -34,7 +35,7 @@ class TestApiReplay(test_plugin.NsxV3PluginTestCaseMixin):
|
||||
|
||||
# remove the extension from the plugin
|
||||
directory.get_plugin().supported_extension_aliases.remove(
|
||||
'api-replay')
|
||||
api_replay.ALIAS)
|
||||
|
||||
# Revert the attributes map back to normal
|
||||
for attr_name in ('ports', 'networks', 'security_groups',
|
||||
|
@ -20,12 +20,15 @@ from openstackclient.tests.unit.network.v2 import fakes as network_fakes
|
||||
from openstackclient.tests.unit.network.v2 import test_port
|
||||
from openstackclient.tests.unit import utils as tests_utils
|
||||
|
||||
from vmware_nsx.extensions import maclearning
|
||||
from vmware_nsx.extensions import providersecuritygroup
|
||||
from vmware_nsx.extensions import vnicindex
|
||||
from vmware_nsx.osc.v2 import port
|
||||
|
||||
|
||||
supported_extensions = ('vnic-index',
|
||||
'provider-security-group',
|
||||
'mac-learning')
|
||||
supported_extensions = (vnicindex.ALIAS,
|
||||
providersecuritygroup.ALIAS,
|
||||
maclearning.ALIAS)
|
||||
|
||||
|
||||
class TestCreatePort(test_port.TestCreatePort):
|
||||
|
@ -24,7 +24,7 @@ from vmware_nsx.extensions import routertype
|
||||
from vmware_nsx.osc.v2 import router
|
||||
|
||||
|
||||
supported_extensions = ('nsxv-router-size', 'nsxv-router-type')
|
||||
supported_extensions = (routersize.ALIAS, routertype.ALIAS)
|
||||
|
||||
|
||||
class TestCreateRouter(test_router.TestCreateRouter):
|
||||
|
@ -20,12 +20,16 @@ from openstackclient.tests.unit.network.v2 import (
|
||||
test_security_group_network as test_security_group)
|
||||
from openstackclient.tests.unit import utils as tests_utils
|
||||
|
||||
|
||||
from vmware_nsx.extensions import providersecuritygroup
|
||||
from vmware_nsx.extensions import securitygrouplogging
|
||||
from vmware_nsx.extensions import securitygrouppolicy
|
||||
from vmware_nsx.osc.v2 import security_group
|
||||
|
||||
|
||||
supported_extensions = ('security-group-logging',
|
||||
'provider-security-group',
|
||||
'security-group-policy')
|
||||
supported_extensions = (securitygrouplogging.ALIAS,
|
||||
providersecuritygroup.ALIAS,
|
||||
securitygrouppolicy.ALIAS)
|
||||
|
||||
|
||||
class TestCreateSecurityGroup(
|
||||
|
@ -19,10 +19,12 @@ import mock
|
||||
from openstackclient.tests.unit.network.v2 import test_subnet
|
||||
from openstackclient.tests.unit import utils as tests_utils
|
||||
|
||||
from vmware_nsx.extensions import dhcp_mtu
|
||||
from vmware_nsx.extensions import dns_search_domain
|
||||
from vmware_nsx.osc.v2 import subnet
|
||||
|
||||
|
||||
supported_extensions = ('dhcp-mtu', 'dns-search-domain')
|
||||
supported_extensions = (dhcp_mtu.ALIAS, dns_search_domain.ALIAS)
|
||||
|
||||
|
||||
class TestCreateSubnet(test_subnet.TestCreateSubnet):
|
||||
|
Loading…
Reference in New Issue
Block a user