]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
attributes: Additional IP address validation
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Fri, 21 Nov 2014 05:16:03 +0000 (14:16 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Mon, 26 Jan 2015 02:55:31 +0000 (11:55 +0900)
commit2794bb89d664355ae1194a0b1f8346c1538caef8
treea38946bcbc1a6493e5ff02521f27dcd8b7063343
parentf2f06faf893f2cbac282e324591312695cc23908
attributes: Additional IP address validation

Introduce an additional IP address validation instead of assuming
that netaddr provides it.  Namely, it ensures that an address
either has ':' (IPv6) or 3 periods like 'xx.xx.xx.xx'. (IPv4)

The "'1' * 59" test case recently introduced by
commit 1681f62ec91b6c3705a14393815542dc1746de71 fails on
some platforms because it's considered a valid address by
their inet_aton.  Examples of such platforms: NetBSD, OS X

While one might argue it's a fault of the platforms, this is
a historical behavior which is probably too late to change there.

(The breakage has been hidden by later UT changes in
commit 35662d07628452d14306f5197871ad64f6396ff3 .
This commit includes a UT change to uncover the problem again.)

Closes-Bug: #1394867
Related-Bug: #1378450
Change-Id: Ibe02f8b7c4d437bf7abbe7304ca138bdcf4bfdb9
neutron/api/v2/attributes.py
neutron/tests/unit/test_attributes.py