]> 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)
committerKevin Benton <blak111@gmail.com>
Fri, 28 Nov 2014 19:37:09 +0000 (11:37 -0800)
commit35662d07628452d14306f5197871ad64f6396ff3
tree7f9ef39d753df6c43e49993e1f47c5e30d9fbb09
parentef86198181649f13da9692b6a2b339e36901aa27
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.

Closes-Bug: #1396932
Change-Id: I003cf14d95070707e43e40d55da62e11a28dfa4e
neutron/api/v2/attributes.py
neutron/tests/unit/test_attributes.py