diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-11-20 08:22:14 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-11-20 08:22:14 +0000 |
commit | cfd3cd9f35ebc946493d0be3b6fb18e87d340900 (patch) | |
tree | dd9e1d9af8940321d021837e30daf4b343b167df | |
parent | 650da7229398184403e6ac07f3f9d009290a7a22 (diff) | |
parent | ad6fefcb4d4068b46b69284e277df6ab2ee30105 (diff) | |
download | neutron-cfd3cd9f35ebc946493d0be3b6fb18e87d340900.tar.gz |
Merge "Fix hostname regex pattern" into stable/juno
-rw-r--r-- | neutron/api/v2/attributes.py | 4 | ||||
-rw-r--r-- | neutron/tests/unit/test_attributes.py | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/neutron/api/v2/attributes.py b/neutron/api/v2/attributes.py index 83471f946e..21486dbd39 100644 --- a/neutron/api/v2/attributes.py +++ b/neutron/api/v2/attributes.py @@ -540,8 +540,8 @@ def convert_to_list(data): return [data] -HOSTNAME_PATTERN = ("(?=^.{1,254}$)(^(?:(?!\d+\.|-)[a-zA-Z0-9_\-]" - "{1,63}(?<!-)\.?)+(?:[a-zA-Z]{2,})$)") +HOSTNAME_PATTERN = ("(?=^.{1,254}$)(^(?:(?!\d+.|-)[a-zA-Z0-9_\-]{1,62}" + "[a-zA-Z0-9]\.?)+(?:[a-zA-Z]{2,})$)") HEX_ELEM = '[0-9A-Fa-f]' UUID_PATTERN = '-'.join([HEX_ELEM + '{8}', HEX_ELEM + '{4}', diff --git a/neutron/tests/unit/test_attributes.py b/neutron/tests/unit/test_attributes.py index 2fb268d07a..f8cb462b3e 100644 --- a/neutron/tests/unit/test_attributes.py +++ b/neutron/tests/unit/test_attributes.py @@ -281,6 +281,7 @@ class TestAttributes(base.BaseTestCase): ['www.hostname.com', 'www.hostname.com'], ['77.hostname.com'], ['1000.0.0.1'], + ['111111111111111111111111111111111111111111111111111111111111'], # noqa None] for ns in ns_pools: |