fix vpnaas subnet_list_or_none type

The validate_subnet_list_or_none validator was rehomed into lib as part
of [1] and registered with the type of 'subnet_list_or_none'. While this
is a good type name, vpnaas already adds a validator with that type in
their master branch today [2]. As a result, running with neutron-lib
master can fail due to re-registration [3]. The way we've addressed this
in the past is to use a new type name in neutron-lib and then just
ensure the new type is used upon consumption.

This patch renames the validation type subnet_list_or_none to
list_of_subnets_or_none to address the issue [3].

[1] https://review.openstack.org/#/c/439972/
[2] https://github.com/openstack/neutron-vpnaas/blob/master/
neutron_vpnaas/extensions/vpnaas.py#L177
[3] http://logs.openstack.org/periodic/git.openstack.org/openstack/
vmware-nsx/master/openstack-tox-py35-with-neutron-lib-master/227d2f0/
job-output.txt.gz#_2018-04-23_06_17_55_841555

Change-Id: If1713edb26fd923047f2f6c022f0557b2f3ec41e
This commit is contained in:
Boden R 2018-04-23 09:53:44 -06:00
parent f9dc35cbd7
commit 59797ca408
3 changed files with 3 additions and 3 deletions

View File

@ -220,7 +220,7 @@ RESOURCE_ATTRIBUTE_MAP = {
'is_visible': True},
'peer_cidrs': {'allow_post': True, 'allow_put': True,
'convert_to': converters.convert_to_list,
'validate': {'type:subnet_list_or_none': None},
'validate': {'type:list_of_subnets_or_none': None},
'is_visible': True,
'default': None},
'local_ep_group_id': {'allow_post': True, 'allow_put': True,

View File

@ -1086,7 +1086,7 @@ validators = {'type:dict': validate_dict,
'type:list_of_any_key_specs_or_none':
validate_any_key_specs_or_none,
'type:service_plugin_type': validate_service_plugin_type,
'type:subnet_list_or_none': validate_subnet_list_or_none,
'type:list_of_subnets_or_none': validate_subnet_list_or_none,
}

View File

@ -4,5 +4,5 @@ features:
``vpnaas``, ``vpn-endpoint-groups`` and ``vpn-flavors``.
- Migrate user facing exceptions into neutron-lib along with the API
definitions.
- A new validator for type ``type:subnet_list_or_none`` to validate
- A new validator for type ``type:list_of_subnets_or_none`` to validate
data is a list of subnet dicts or ``None`` is added too.