Add ipv6 canonical address converter to API

This patch takes care of converting of IPv6 address
for gateway-ip, cidr and allocation-pools to canonical
format.

Closes-Bug:1531103
Change-Id: Ibef0bd9a2f7b7dd8ddccc183f17aa31e426c7fd0
This commit is contained in:
Reedip 2017-08-12 06:25:32 +00:00 committed by reedip
parent e0cc5efb74
commit fe389eea25
2 changed files with 14 additions and 4 deletions

View File

@ -58,17 +58,21 @@ RESOURCE_ATTRIBUTE_MAP = {
'cidr': {'allow_post': True,
'allow_put': False,
'default': constants.ATTR_NOT_SPECIFIED,
'convert_to': converters.convert_cidr_to_canonical_format,
'validate': {'type:subnet_or_none': None},
'required_by_policy': False,
'is_visible': True},
'gateway_ip': {'allow_post': True, 'allow_put': True,
'default': constants.ATTR_NOT_SPECIFIED,
'convert_to': converters.convert_ip_to_canonical_format,
'validate': {'type:ip_address_or_none': None},
'is_visible': True},
'allocation_pools': {'allow_post': True, 'allow_put': True,
'default': constants.ATTR_NOT_SPECIFIED,
'validate': {'type:ip_pools': None},
'is_visible': True},
'allocation_pools': {
'allow_post': True, 'allow_put': True,
'default': constants.ATTR_NOT_SPECIFIED,
'convert_to': converters.convert_ip_to_canonical_format,
'validate': {'type:ip_pools': None},
'is_visible': True},
'dns_nameservers': {'allow_post': True, 'allow_put': True,
'convert_to':
converters.convert_none_to_empty_list,

View File

@ -0,0 +1,6 @@
---
fixes:
- |
The ``gateway`` , ``allocation_pools`` and ``cidr`` attributes of a Subnet with IPv6 addresses
are now converted to IPv6 canonical format to address.
`bug 1531103 <https://bugs.launchpad.net/neutron/+bug/1531103>`_