]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix hostname validation for nameservers
authorKevin Benton <blak111@gmail.com>
Thu, 27 Nov 2014 09:45:29 +0000 (01:45 -0800)
committerIhar Hrachyshka <ihrachys@redhat.com>
Thu, 4 Dec 2014 14:13:04 +0000 (15:13 +0100)
commit209160ba5804c21b833cb285c26da2789975cb90
treeb12e106a2f8bf1a62c24d4387446fc653e7614a3
parenta00e20c27f9dcc9cc03cbd74daf49e4438b3242e
Fix hostname validation for nameservers

Fixes the hostname validation to align with the RFC's demands[1].
This was done by replacing the full regex with a function that
broke the FQDN into individual components that were easier to
reason about with regular expressions.

Also added several test cases for domains so if someone wants
to convert it back to pure regex there will be better test vectors.

1. RFC 1123 says an all-digit hostname is allowed in section 2.1. It
   says that this more liberal syntax MUST be supported.

Conflicts:
neutron/tests/unit/test_attributes.py

Closes-Bug: #1396932
Change-Id: I003cf14d95070707e43e40d55da62e11a28dfa4e
(cherry picked from commit 35662d07628452d14306f5197871ad64f6396ff3)
neutron/api/v2/attributes.py
neutron/tests/unit/test_attributes.py