Merge "Move network segment range types to lib constants"

This commit is contained in:
Zuul 2019-01-21 21:25:22 +00:00 committed by Gerrit Code Review
commit 0e30615d59
3 changed files with 11 additions and 6 deletions

View File

@ -35,11 +35,6 @@ RESOURCE_NAME = 'network_segment_range'
# The plural for the resource.
COLLECTION_NAME = 'network_segment_ranges'
NETWORK_SEGMENT_RANGE_TYPE_LIST = [constants.TYPE_VLAN,
constants.TYPE_VXLAN,
constants.TYPE_GRE,
constants.TYPE_GENEVE]
# Min ID for VLAN, VXLAN, GRE and GENEVE all equal to 1; Max ID for them are
# 4094, 2 ** 24 - 1, 2 ** 32 - 1 and 2 ** 24 - 1 respectively.
# Take the largest range: [MIN_GRE_ID, MAX_GRE_ID] as the limit for validation.
@ -82,7 +77,8 @@ RESOURCE_ATTRIBUTE_MAP = {
'network_type': {'allow_post': True,
'allow_put': False,
'validate': {
'type:values': NETWORK_SEGMENT_RANGE_TYPE_LIST},
'type:values':
constants.NETWORK_SEGMENT_RANGE_TYPES},
'default': constants.ATTR_NOT_SPECIFIED,
'is_filter': True,
'is_visible': True},

View File

@ -289,6 +289,9 @@ TYPE_VXLAN = 'vxlan'
TYPE_VLAN = 'vlan'
TYPE_NONE = 'none'
# List of supported network segment range types
NETWORK_SEGMENT_RANGE_TYPES = [TYPE_VLAN, TYPE_VXLAN, TYPE_GRE, TYPE_GENEVE]
# Values for network_type
# For VLAN Network

View File

@ -0,0 +1,6 @@
---
other:
- |
The ``neutron_lib.api.definitions.network_segment_range.NETWORK_SEGMENT_RANGE_TYPE_LIST``
constant was moved to ``neutron_lib.constants`` and renamed to
``NETWORK_SEGMENT_RANGE_TYPES`` so that it can be used elsewhere.