rehome plugin common constants
This patch rehomes a bulk of constants from neutron.plugins.common.constants as they are used by a number of our sub-projects [1]. Notable differences include: - Service operation status constants are not defined in the plugin constants as they are already available in neutron_lib.constants. - The DEFAULT_SERVICE_PLUGINS is not included. This one appears to be neutron specific and should likely be made private in neutron. - The EXT_TO_SERVICE_MAPPING dict is not included. We'll push this in a separate change so we can discuss in greater detail. A release note is also included. [1] http://codesearch.openstack.org/?q=from%20neutron %5C.plugins%5C.common%20import%20constants Change-Id: I6e86d737064f97d82e36a4e82a9f2a22fd38febe
This commit is contained in:
parent
8ee998d9c4
commit
1331fb2083
@ -203,6 +203,12 @@ IPTABLES_PROTOCOL_MAP = {PROTO_NAME_DCCP: 'dccp',
|
||||
PROTO_NAME_TCP: 'tcp',
|
||||
PROTO_NAME_UDP: 'udp'}
|
||||
|
||||
# IP header length
|
||||
IP_HEADER_LENGTH = {
|
||||
4: 20,
|
||||
6: 40,
|
||||
}
|
||||
|
||||
# ICMPv6 types:
|
||||
# Destination Unreachable (1)
|
||||
ICMPV6_TYPE_DEST_UNREACH = 1
|
||||
@ -260,6 +266,45 @@ DHCPV6_STATELESS = 'dhcpv6-stateless'
|
||||
IPV6_SLAAC = 'slaac'
|
||||
IPV6_MODES = [DHCPV6_STATEFUL, DHCPV6_STATELESS, IPV6_SLAAC]
|
||||
|
||||
ACTIVE_PENDING_STATUSES = (
|
||||
ACTIVE,
|
||||
PENDING_CREATE,
|
||||
PENDING_UPDATE
|
||||
)
|
||||
|
||||
# Network Type constants
|
||||
TYPE_FLAT = 'flat'
|
||||
TYPE_GENEVE = 'geneve'
|
||||
TYPE_GRE = 'gre'
|
||||
TYPE_LOCAL = 'local'
|
||||
TYPE_VXLAN = 'vxlan'
|
||||
TYPE_VLAN = 'vlan'
|
||||
TYPE_NONE = 'none'
|
||||
|
||||
# Values for network_type
|
||||
|
||||
# For VLAN Network
|
||||
MIN_VLAN_TAG = 1
|
||||
MAX_VLAN_TAG = 4094
|
||||
|
||||
# For Geneve Tunnel
|
||||
MIN_GENEVE_VNI = 1
|
||||
MAX_GENEVE_VNI = 2 ** 24 - 1
|
||||
|
||||
# For GRE Tunnel
|
||||
MIN_GRE_ID = 1
|
||||
MAX_GRE_ID = 2 ** 32 - 1
|
||||
|
||||
# For VXLAN Tunnel
|
||||
MIN_VXLAN_VNI = 1
|
||||
MAX_VXLAN_VNI = 2 ** 24 - 1
|
||||
VXLAN_UDP_PORT = 4789
|
||||
|
||||
# Overlay (tunnel) protocol overhead
|
||||
GENEVE_ENCAP_MIN_OVERHEAD = 30
|
||||
GRE_ENCAP_OVERHEAD = 22
|
||||
VXLAN_ENCAP_OVERHEAD = 30
|
||||
|
||||
|
||||
class Sentinel(object):
|
||||
"""A constant object that does not change even when copied."""
|
||||
@ -300,6 +345,7 @@ SNAT_INT_DEV_PREFIX = 'sg-'
|
||||
##########################
|
||||
# Plugin constants that are universally used across all neutron repos.
|
||||
# The alias for the core plugin.
|
||||
# TODO(boden): remove and replace consumer usage with plugins/constants.py
|
||||
CORE = 'CORE'
|
||||
# The alias for the L3 plugin.
|
||||
L3 = 'L3_ROUTER_NAT'
|
||||
|
24
neutron_lib/plugins/constants.py
Normal file
24
neutron_lib/plugins/constants.py
Normal file
@ -0,0 +1,24 @@
|
||||
# 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.
|
||||
|
||||
# Well-known service type constants:
|
||||
LOADBALANCER = "LOADBALANCER"
|
||||
LOADBALANCERV2 = "LOADBALANCERV2"
|
||||
FIREWALL = "FIREWALL"
|
||||
VPN = "VPN"
|
||||
METERING = "METERING"
|
||||
FLAVORS = "FLAVORS"
|
||||
QOS = "QOS"
|
||||
CORE = 'CORE'
|
||||
L3 = 'L3_ROUTER_NAT'
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- Many of the constants from ``neutron.plugins.common.constants`` are
|
||||
now available in ``neutron_lib.plugins.constants`` and
|
||||
``neutron_lib.constants``.
|
Loading…
x
Reference in New Issue
Block a user