Merge "Fix hostname regex pattern"

This commit is contained in:
Jenkins 2014-11-20 01:41:30 +00:00 committed by Gerrit Code Review
commit 47f754c2f9
2 changed files with 3 additions and 2 deletions

View File

@ -538,8 +538,8 @@ def convert_to_list(data):
return [data] return [data]
HOSTNAME_PATTERN = ("(?=^.{1,254}$)(^(?:(?!\d+\.|-)[a-zA-Z0-9_\-]" HOSTNAME_PATTERN = ("(?=^.{1,254}$)(^(?:(?!\d+.|-)[a-zA-Z0-9_\-]{1,62}"
"{1,63}(?<!-)\.?)+(?:[a-zA-Z]{2,})$)") "[a-zA-Z0-9]\.?)+(?:[a-zA-Z]{2,})$)")
HEX_ELEM = '[0-9A-Fa-f]' HEX_ELEM = '[0-9A-Fa-f]'
UUID_PATTERN = '-'.join([HEX_ELEM + '{8}', HEX_ELEM + '{4}', UUID_PATTERN = '-'.join([HEX_ELEM + '{8}', HEX_ELEM + '{4}',

View File

@ -281,6 +281,7 @@ class TestAttributes(base.BaseTestCase):
['www.hostname.com', 'www.hostname.com'], ['www.hostname.com', 'www.hostname.com'],
['77.hostname.com'], ['77.hostname.com'],
['1000.0.0.1'], ['1000.0.0.1'],
['111111111111111111111111111111111111111111111111111111111111'], # noqa
None] None]
for ns in ns_pools: for ns in ns_pools: