allow for non standard hostnames

* Changed parse_addresses to throw exceptions instead of passing None
* Switched callers to trap and pass through the original values.
* Added very verbose notice
* Look at deprecating this and possibly validate at plugin instead
fixes #13608
This commit is contained in:
Brian Coca 2015-12-21 13:06:48 -05:00
parent 593d80c63d
commit 75e94e0cba
5 changed files with 49 additions and 29 deletions

View file

@ -71,7 +71,12 @@ class TestParseAddress(unittest.TestCase):
for t in self.tests:
test = self.tests[t]
(host, port) = parse_address(t)
try:
(host, port) = parse_address(t)
except:
host = None
port = None
assert host == test[0]
assert port == test[1]
@ -79,6 +84,11 @@ class TestParseAddress(unittest.TestCase):
for t in self.range_tests:
test = self.range_tests[t]
(host, port) = parse_address(t, allow_ranges=True)
try:
(host, port) = parse_address(t, allow_ranges=True)
except:
host = None
port = None
assert host == test[0]
assert port == test[1]