NSX|V3+P: Fix address pairs validation
1. /32 cidr is allowed 2. ipv6 validation is not necessary as the backend supports cidrs. Change-Id: If8027db6190486a2a0c6410ad119810f4938f13d
This commit is contained in:
parent
4cadc580ae
commit
db088c6e9c
@ -323,8 +323,11 @@ class NsxPluginV3Base(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
|||||||
def _validate_address_pairs(self, address_pairs):
|
def _validate_address_pairs(self, address_pairs):
|
||||||
for pair in address_pairs:
|
for pair in address_pairs:
|
||||||
ip = pair.get('ip_address')
|
ip = pair.get('ip_address')
|
||||||
if len(ip.split('/')) > 1:
|
# Validate ipv4 cidrs (No limitation on ipv6):
|
||||||
LOG.error("cidr is not supported in allowed address pairs")
|
if ':' not in ip:
|
||||||
|
if len(ip.split('/')) > 1 and ip.split('/')[1] != '32':
|
||||||
|
LOG.error("cidr %s is not supported in allowed address "
|
||||||
|
"pairs", ip)
|
||||||
raise nsx_exc.InvalidIPAddress(ip_address=ip)
|
raise nsx_exc.InvalidIPAddress(ip_address=ip)
|
||||||
|
|
||||||
def _validate_number_of_address_pairs(self, port):
|
def _validate_number_of_address_pairs(self, port):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user